Spaces:
Sleeping
Sleeping
Download src/utils/logger.py from VelaTest/PhysioAssist: direct link, hf CLI and curl.
- Browser
- Download file 682 Bytes
-
https://huggingface.co/spaces/VelaTest/PhysioAssist/resolve/main/src/utils/logger.py
- Command line
-
hf download hf://spaces/VelaTest/PhysioAssist/src/utils/logger.py
-
curl -L -o logger.py https://huggingface.co/spaces/VelaTest/PhysioAssist/resolve/main/src/utils/logger.py
682 Bytes
| import logging | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format='%(asctime)s - %(levelname)s - %(message)s', | |
| datefmt='%Y-%m-%d %H:%M') | |
| def log(log_type,message): | |
| try: | |
| log_type = log_type.lower() | |
| if log_type == "info": | |
| return logging.info(message) | |
| elif log_type == "debug": | |
| return logging.debug(message) | |
| elif log_type == "warning": | |
| return logging.error(message) | |
| elif log_type == "critical": | |
| return logging.critical(message) | |
| elif log_type == "error": | |
| return logging.error(message) | |
| except Exception as e: | |
| return f"Invalid log type.Error : {e}" | |