use gmtime as time formatter

This commit is contained in:
A_D committed 2022-01-20 15:52:44 +02:00
1 parent f2e38afc39
commit 85f7bddef0
1 file changed
+4
+4
View File
@@ -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):