From 85f7bddef0b2f37de3812d81e3e2f2a051786923 Mon Sep 17 00:00:00 2001 From: A_D Date: Thu, 20 Jan 2022 15:52:44 +0200 Subject: [PATCH] use gmtime as time formatter --- EDMCLogging.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/EDMCLogging.py b/EDMCLogging.py index c00b7ab9..c98ebe04 100644 --- a/EDMCLogging.py +++ b/EDMCLogging.py @@ -46,6 +46,7 @@ from fnmatch import fnmatch # So that any warning about accessing a protected member is only in one place. from sys import _getframe as getframe from threading import get_native_id as thread_native_id +from time import gmtime from traceback import print_exc from typing import TYPE_CHECKING, Tuple, cast @@ -91,6 +92,9 @@ logging.Logger.trace = lambda self, message, *args, **kwargs: self._log( # type **kwargs ) +# make logging use UTC for times +logging.Formatter.converter = gmtime + def _trace_if(self: logging.Logger, condition: str, message: str, *args, **kwargs) -> None: if any(fnmatch(condition, p) for p in config_mod.trace_on):