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 Eric.Hanchrow
Date 2013-10-30.23:01:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383174098.42.0.658562417274.issue19455@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:01:38Eric.Hanchrowsetrecipients: + Eric.Hanchrow
2013-10-30 23:01:38Eric.Hanchrowsetmessageid: <1383174098.42.0.658562417274.issue19455@psf.upfronthosting.co.za>
2013-10-30 23:01:38Eric.Hanchrowlinkissue19455 messages
2013-10-30 23:01:38Eric.Hanchrowcreate