Spaces:
Runtime error
Runtime error
Download custom_logging.py from clairify/siddharth-chat: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/spaces/clairify/siddharth-chat/resolve/main/custom_logging.py
- Command line
-
hf download hf://spaces/clairify/siddharth-chat/custom_logging.py
-
curl -L -o custom_logging.py https://huggingface.co/spaces/clairify/siddharth-chat/resolve/main/custom_logging.py
446 Bytes
| import logging | |
| IMPORTANT_LEVEL_NUM = 25 | |
| logging.addLevelName(IMPORTANT_LEVEL_NUM, "IMPORTANT") | |
| def important(self, message, *args, **kws): | |
| if self.isEnabledFor(IMPORTANT_LEVEL_NUM): | |
| self._log(IMPORTANT_LEVEL_NUM, message, args, **kws) | |
| logging.Logger.important = important | |
| logging.basicConfig(level=IMPORTANT_LEVEL_NUM, format='%(asctime)s - %(levelname)s - %(message)s') | |
| def get_logger(name): | |
| return logging.getLogger(name) | |