Message201781
Put the following into a file named "repro.py", then type "python repro.py" at your shell. You'll see ``AttributeError: 'CustomAdapter' object has no attribute 'setLevel'``
import logging logging.basicConfig ()
class CustomAdapter(logging.LoggerAdapter):
def process(self, msg, kwargs):
return '[%s] %s' % (self.extra['connid'], msg), kwargs
logger = logging.getLogger(__name__)
adapter = CustomAdapter(logger, {'connid': '1234'})
adapter.setLevel (logging.WARN)
adapter.warning ("Ahoy matey") |
|
Date |
User |
Action |
Args |
2013-10-30 23:37:51 | Arfrever | unlink | issue19063 messages |
2013-10-30 22:59:37 | Eric.Hanchrow | set | recipients:
+ Eric.Hanchrow, barry, Arfrever, r.david.murray, apollo13, vajrasky |
2013-10-30 22:59:37 | Eric.Hanchrow | set | messageid: <1383173977.82.0.544511504832.issue19063@psf.upfronthosting.co.za> |
2013-10-30 22:59:37 | Eric.Hanchrow | link | issue19063 messages |
2013-10-30 22:59:37 | Eric.Hanchrow | create | |
|