Spaces:
Runtime error
Runtime error
Download logging_utils.py from CenterFor/AskJesus0.3: direct link, hf CLI and curl.
- Browser
- Download file 514 Bytes
-
https://huggingface.co/spaces/CenterFor/AskJesus0.3/resolve/main/logging_utils.py
- Command line
-
hf download hf://spaces/CenterFor/AskJesus0.3/logging_utils.py
-
curl -L -o logging_utils.py https://huggingface.co/spaces/CenterFor/AskJesus0.3/resolve/main/logging_utils.py
514 Bytes
| import logging | |
| def setup_logging_to_file(filename): | |
| logging.basicConfig( | |
| filename=filename, | |
| level=logging.INFO, | |
| #format='%(asctime)s - %(levelname)s - %(message)s' | |
| format='%(message)s' | |
| ) | |
| def sanitize_filename(filename): | |
| invalid_chars = '\/:*?"<>|' | |
| return ''.join('_' if c in invalid_chars else c for c in filename) | |
| def close_logging_handlers(): | |
| for handler in logging.root.handlers[:]: | |
| handler.close() | |
| logging.root.removeHandler(handler) | |