donate-cpu-server.py: only use more precise timestamp for logging - will unbreak "Time" columns and stale report (#4909)

This commit is contained in:
Oliver Stöneberg 2023-04-04 11:37:16 +02:00 committed by GitHub
parent 9c8ebbcefc
commit 16a9f54977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -26,7 +26,7 @@ from urllib.parse import urlparse
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
# changes)
SERVER_VERSION = "1.3.37"
SERVER_VERSION = "1.3.38"
OLD_VERSION = '2.10'
@ -49,7 +49,8 @@ logger.addHandler(handler_file)
def print_ts(msg) -> None:
print('[{}] {}'.format(strDateTime(), msg))
dt = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
print('[{}] {}'.format(dt, msg))
# Set up an exception hook for all uncaught exceptions so they can be logged
@ -65,7 +66,7 @@ sys.excepthook = handle_uncaught_exception
def strDateTime() -> str:
return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
return datetime.datetime.now().strftime('%Y-%m-%d %H:%M')
def dateTimeFromStr(datestr: str) -> datetime.datetime: