Skip to content

Commit 16a9f54

Browse files
authored
donate-cpu-server.py: only use more precise timestamp for logging - will unbreak "Time" columns and stale report (#4909)
1 parent 9c8ebbc commit 16a9f54

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tools/donate-cpu-server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
2727
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
2828
# changes)
29-
SERVER_VERSION = "1.3.37"
29+
SERVER_VERSION = "1.3.38"
3030

3131
OLD_VERSION = '2.10'
3232

@@ -49,7 +49,8 @@
4949

5050

5151
def print_ts(msg) -> None:
52-
print('[{}] {}'.format(strDateTime(), msg))
52+
dt = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
53+
print('[{}] {}'.format(dt, msg))
5354

5455

5556
# Set up an exception hook for all uncaught exceptions so they can be logged
@@ -65,7 +66,7 @@ def handle_uncaught_exception(exc_type, exc_value, exc_traceback):
6566

6667

6768
def strDateTime() -> str:
68-
return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
69+
return datetime.datetime.now().strftime('%Y-%m-%d %H:%M')
6970

7071

7172
def dateTimeFromStr(datestr: str) -> datetime.datetime:

0 commit comments

Comments
 (0)