This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Eric.Hanchrow
Recipients Arfrever, Eric.Hanchrow, apollo13, barry, r.david.murray, vajrasky
Date 2013-10-30.22:59:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383173977.82.0.544511504832.issue19063@psf.upfronthosting.co.za>
In-reply-to
Content
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")
History
Date User Action Args
2013-10-30 23:37:51Arfreverunlinkissue19063 messages
2013-10-30 22:59:37Eric.Hanchrowsetrecipients: + Eric.Hanchrow, barry, Arfrever, r.david.murray, apollo13, vajrasky
2013-10-30 22:59:37Eric.Hanchrowsetmessageid: <1383173977.82.0.544511504832.issue19063@psf.upfronthosting.co.za>
2013-10-30 22:59:37Eric.Hanchrowlinkissue19063 messages
2013-10-30 22:59:37Eric.Hanchrowcreate