New submission from Ondrej Sejvl: Hi,
in doc https://docs.python.org/3.4/library/logging.html#logrecord-attributes there is args You shouldn’t need to format this yourself. The tuple of arguments merged into msg to produce message. But when I log message with 1 arg - a dict - in record.args will be this dict ``` import logging class H(logging.Handler): def emit(self, record): print(record.args, type(record.args)) lgr = logging.getLogger() lgr.addHandler(H()) lgr.error("msg", 1) lgr.error("msg", dict(a=1)) lgr.error("msg", dict(a=1), 2) ``` output: ``` (1,) <class 'tuple'> {'a': 1} <class 'dict'> ({'a': 1}, 2) <class 'tuple'> ``` ---------- messages: 253673 nosy: sejvlond priority: normal severity: normal status: open title: LogRecord attributes are not tuple, when logging only dict versions: Python 2.7, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25508> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com