Spaces:
Paused
Paused
Download logger.py from no-name-here/testing: direct link, hf CLI and curl.
- Browser
- Download file 596 Bytes
-
https://huggingface.co/spaces/no-name-here/testing/resolve/main/logger.py
- Command line
-
hf download hf://spaces/no-name-here/testing/logger.py
-
curl -L -o logger.py https://huggingface.co/spaces/no-name-here/testing/resolve/main/logger.py
596 Bytes
| import logging | |
| import os | |
| from logging.handlers import RotatingFileHandler | |
| try: | |
| os.remove("logs.txt") | |
| except Exception: | |
| pass | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="[%(asctime)s - %(levelname)s] - %(funcName)s() - Line %(lineno)d: %(name)s - %(message)s", | |
| datefmt="%d-%b-%y %I:%M:%S %p", | |
| handlers=[ | |
| RotatingFileHandler("logs.txt", mode="w+", maxBytes=5_000_000, backupCount=10), | |
| logging.StreamHandler(), | |
| ], | |
| ) | |
| logging.getLogger("pyrogram").setLevel(logging.ERROR) | |
| def LOGGER(name: str) -> logging.Logger: | |
| return logging.getLogger(name) | |