Author gidi_avrahami
Recipients gidi_avrahami
Date 2007-11-21.22:41:16
SpamBayes Score 0.0421187
Marked as misclassified No
Message-id <1195684877.23.0.0511912191493.issue1484@psf.upfronthosting.co.za>
In-reply-to
Content
I am using the logging module with multiple loggers and the following
behavior seems incorrect to me:

I set the root logger's level to WARN and the foo.bar module's logger's
level to DEBUG, and the foo.bar logger should is writing to a file.  So
basically, I want foo.bar to log itself in details behind the scenes
while the main console is quiet.

However, I still get all the sebug info printed to the console.  When I
trace down the code, I see that callHandlers() is climbing up the logger
hierarchy, but it's comparing record.level to hdlr.level, not to
c.level.  The handler levels, however, don't appear to be set normally
(i.e., after I do getLogger("foo.bar").setLevel, its handlers stay at
level NOTSET).  As a result, callHandlers will call all the handlers
above the first one, no matter what the loggers level.

Is this intentional?  If it is, how should I get the behavior that I
described above?  (I could set propagate=False, but in fact if the rott
logger is DEBUG then I do want it to print the foo.bar messages)
History
Date User Action Args
2007-11-21 22:41:17gidi_avrahamisetspambayes_score: 0.0421187 -> 0.0421187
recipients: + gidi_avrahami
2007-11-21 22:41:17gidi_avrahamisetspambayes_score: 0.0421187 -> 0.0421187
messageid: <1195684877.23.0.0511912191493.issue1484@psf.upfronthosting.co.za>
2007-11-21 22:41:17gidi_avrahamilinkissue1484 messages
2007-11-21 22:41:16gidi_avrahamicreate