Message253673
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'>
``` |
|
Date |
User |
Action |
Args |
2015-10-29 10:22:02 | sejvlond | set | recipients:
+ sejvlond |
2015-10-29 10:22:02 | sejvlond | set | messageid: <1446114122.71.0.187409652652.issue25508@psf.upfronthosting.co.za> |
2015-10-29 10:22:02 | sejvlond | link | issue25508 messages |
2015-10-29 10:22:02 | sejvlond | create | |
|