Spaces:
Runtime error
Runtime error
Download Pinpoint/Logger.py from User1342/WatchTower: direct link, hf CLI and curl.
- Browser
- Download file 720 Bytes
-
https://huggingface.co/spaces/User1342/WatchTower/resolve/main/Pinpoint/Logger.py
- Command line
-
hf download hf://spaces/User1342/WatchTower/Pinpoint/Logger.py
-
curl -L -o Logger.py https://huggingface.co/spaces/User1342/WatchTower/resolve/main/Pinpoint/Logger.py
720 Bytes
| from datetime import datetime | |
| class logger(): | |
| """ | |
| A wrapper class around the Python print function used to only print | |
| """ | |
| DEBUG = False | |
| def print_message(message, logging_level=0): | |
| """ | |
| A wrapper function around the Python print function used to only print | |
| :param message: the message to print | |
| :param override_debug: a boolean on if the DEBUG status should be override. if True a log will be printed, | |
| irrespective of if in Debug mode. | |
| """ | |
| if logging_level >= 1 or logger.DEBUG: | |
| now = datetime.now() | |
| current_time = now.strftime("%H:%M:%S") | |
| print("{} | {}".format(current_time, message)) | |