Re: Making logging.getLogger() simpler

2010-09-19 Thread Vinay Sajip
On Sep 19, 7:52 pm, Vinay Sajip wrote: > If you are writing a library, you will typically: > 2. If you want to force your users (application developers) to add > handlers explicitly to their loggers, set your top-level logger's > propagate flag to False. Sorry, in the above text, where it says "t

Re: Making logging.getLogger() simpler

2010-09-19 Thread Vinay Sajip
On Sep 18, 5:35 pm, Lie Ryan wrote: > I was expecting this to work: > >   importlogging >   logger =logging.getLogger(__name__) >   logger.warn('this is a warning') > > instead it produced the error: > >   No handlers could be found for logger "__main__" > > However, if instead I do: > >   importl

Re: Making logging.getLogger() simpler

2010-09-19 Thread Kev Dwyer
On Sun, 19 Sep 2010 02:35:15 +1000, Lie Ryan wrote: > I was expecting this to work: > > import logging > logger = logging.getLogger(__name__) > logger.warn('this is a warning') > > instead it produced the error: > > No handlers could be found for logger "__main__" > > > However, if in