HealthAI-Chef / log_util.py
kikomiko's picture
init
96f6720
raw
history blame contribute delete
581 Bytes
import logging
import os
from dotenv import load_dotenv
load_dotenv()
PROJECT_NAME = 'healthai-chef'
default_log_args = {
'level': logging.DEBUG if int(os.getenv('DEBUG', '0')) else logging.INFO,
'format': '%(asctime)s [%(levelname)s] %(filename)s:%(lineno)d - %(message)s',
'datefmt': '%d-%b-%y %H:%M:%S',
'force': True,
}
logging.basicConfig(**default_log_args)
logger = logging.getLogger(PROJECT_NAME)
# disable 3rd party logs
LOGGERS_TO_DISABLE = [
]
for logger_name in LOGGERS_TO_DISABLE:
logging.getLogger(logger_name).setLevel(logging.CRITICAL + 1)