add COLOR_LOG config
This commit is contained in:
parent
4caafc7e7b
commit
df3838480d
|
@ -25,6 +25,7 @@ else:
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
RESET_DB = "RESET_DB" in os.environ
|
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
|
# Allow user to have 1 year of premium: set the expiration_date to 1 year more
|
||||||
PROMO_CODE = "SIMPLEISBETTER"
|
PROMO_CODE = "SIMPLEISBETTER"
|
||||||
|
|
|
@ -13,6 +13,7 @@ from app.config import (
|
||||||
CLOUDWATCH_LOG_GROUP,
|
CLOUDWATCH_LOG_GROUP,
|
||||||
ENABLE_CLOUDWATCH,
|
ENABLE_CLOUDWATCH,
|
||||||
CLOUDWATCH_LOG_STREAM,
|
CLOUDWATCH_LOG_STREAM,
|
||||||
|
COLOR_LOG,
|
||||||
)
|
)
|
||||||
|
|
||||||
_log_format = "%(asctime)s - %(name)s - %(levelname)s - %(process)d - %(module)s:%(lineno)d - %(funcName)s - %(message)s"
|
_log_format = "%(asctime)s - %(name)s - %(levelname)s - %(process)d - %(module)s:%(lineno)d - %(funcName)s - %(message)s"
|
||||||
|
@ -66,6 +67,7 @@ def _get_logger(name):
|
||||||
# no propagation to avoid propagating to root logger
|
# no propagation to avoid propagating to root logger
|
||||||
logger.propagate = False
|
logger.propagate = False
|
||||||
|
|
||||||
|
if COLOR_LOG:
|
||||||
coloredlogs.install(level="DEBUG", logger=logger)
|
coloredlogs.install(level="DEBUG", logger=logger)
|
||||||
|
|
||||||
return logger
|
return logger
|
||||||
|
|
Loading…
Reference in a new issue