Message192744
Hello.
I noticed strange behavior of logging module, when debugging my code:
$ python
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.error('asdf')
ERROR:root:asdf
>>> logging.error('asdf', extra={'msg':123})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/logging/__init__.py", line 1575, in error
root.error(msg, *args, **kwargs)
File "/usr/lib/python2.7/logging/__init__.py", line 1166, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/lib/python2.7/logging/__init__.py", line 1257, in _log
record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
File "/usr/lib/python2.7/logging/__init__.py", line 1235, in makeRecord
raise KeyError("Attempt to overwrite %r in LogRecord" % key)
KeyError: "Attempt to overwrite 'msg' in LogRecord"
Originally code was extra=locals() and 'msg' was local variable, but it doesn't matter. |
|
Date |
User |
Action |
Args |
2013-07-09 12:42:45 | amezhenin | set | recipients:
+ amezhenin |
2013-07-09 12:42:45 | amezhenin | set | messageid: <1373373765.43.0.0479978783535.issue18413@psf.upfronthosting.co.za> |
2013-07-09 12:42:45 | amezhenin | link | issue18413 messages |
2013-07-09 12:42:45 | amezhenin | create | |
|