add COLOR_LOG config

This commit is contained in:
Son NK 2019-12-08 16:16:28 +01:00
parent 4caafc7e7b
commit df3838480d
2 changed files with 4 additions and 1 deletions

View file

@ -25,6 +25,7 @@ else:
load_dotenv()
RESET_DB = "RESET_DB" in os.environ
COLOR_LOG = "COLOR_LOG" in os.environ
# Allow user to have 1 year of premium: set the expiration_date to 1 year more
PROMO_CODE = "SIMPLEISBETTER"

View file

@ -13,6 +13,7 @@ from app.config import (
CLOUDWATCH_LOG_GROUP,
ENABLE_CLOUDWATCH,
CLOUDWATCH_LOG_STREAM,
COLOR_LOG,
)
_log_format = "%(asctime)s - %(name)s - %(levelname)s - %(process)d - %(module)s:%(lineno)d - %(funcName)s - %(message)s"
@ -66,7 +67,8 @@ def _get_logger(name):
# no propagation to avoid propagating to root logger
logger.propagate = False
coloredlogs.install(level="DEBUG", logger=logger)
if COLOR_LOG:
coloredlogs.install(level="DEBUG", logger=logger)
return logger