Spaces:
Runtime error
Runtime error
Download log_util.py from Topcoder-Platform/HealthAI-Chef: direct link, hf CLI and curl.
- Browser
- Download file 581 Bytes
-
https://huggingface.co/spaces/Topcoder-Platform/HealthAI-Chef/resolve/main/log_util.py
- Command line
-
hf download hf://spaces/Topcoder-Platform/HealthAI-Chef/log_util.py
-
curl -L -o log_util.py https://huggingface.co/spaces/Topcoder-Platform/HealthAI-Chef/resolve/main/log_util.py
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) | |