1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +03:00

use gmtime as time formatter

This commit is contained in:
A_D 2022-01-20 15:52:44 +02:00
parent f2e38afc39
commit 85f7bddef0
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

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):