python logging

Rafael Durán Castañeda rafadurancastaneda at gmail.com
Wed May 18 18:21:56 EDT 2011


On 19/05/11 00:10, Ian Kelly wrote:
> 2011/5/18 Rafael Durán Castañeda<rafadurancastaneda at gmail.com>:
>> I think you are confuse because of you are looking at advanced logging,
>> where getLogger is being used. Simple logging works without any
>> configuration, getLogger doesn't.
> It seems to work without any configuration just as well as the root logger:
>
>>>> import logging
>>>> logging.getLogger('foo').warning('test')
> WARNING:foo:test
>
> Or am I misunderstanding you?
Are you using python 2.x or 3.x? At python 2.7 using:

import logging
logging.getLogger('log').warning('test')

I got:

No handlers could be found for logger "log"





More information about the Python-list mailing list