diff --git a/tfw/logging.py b/tfw/logging.py index dad7499..f05958e 100644 --- a/tfw/logging.py +++ b/tfw/logging.py @@ -2,6 +2,7 @@ from datetime import datetime from typing import TextIO, Union from dataclasses import dataclass +from collections.abc import Mapping from traceback import format_exception from logging import DEBUG, getLogger, Handler, Formatter, Filter @@ -81,7 +82,7 @@ class LogFormatter(Formatter): def format(self, record): time = datetime.utcfromtimestamp(record.created).strftime('%H:%M:%S') if record.args: - tuple_args = (record.args,) if isinstance(record.args, dict) else record.args + tuple_args = (record.args,) if isinstance(record.args, Mapping) else record.args clean_args = tuple((self.trim(arg) for arg in tuple_args)) message = record.msg % clean_args else: