Skip to content

Commit 8bc4c3e

Browse files
committed
Localtime is kind of pointless without an RTC, so just use monotonic
1 parent 238fa6f commit 8bc4c3e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

logging.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,7 @@ def format(self, level, msg):
8282
:param msg: the message to log
8383
8484
"""
85-
now = time.localtime()
86-
time_vals = (now.tm_year, now.tm_mon, now.tm_mday,
87-
now.tm_hour, now.tm_min, now.tm_sec)
88-
timestamp = '%4d/%02d/%02d %02d:%02d:%02d' % time_vals
89-
return '{0}: {1} - {2}'.format(timestamp, level_for(level), msg)
85+
return '{0}: {1} - {2}'.format(time.monotonic(), level_for(level), msg)
9086

9187
def emit(self, level, msg):
9288
"""Send a message where it should go.

0 commit comments

Comments
 (0)