tags:

views:

40

answers:

2

Is there an easy way with python's logging module to send messages with a DEBUG or INFO level and the one with a higher level to different streams?

Is a good idea anyway?

+3  A: 

Yes. You must define multiple handlers for your logging.

http://docs.python.org/library/logging.html#logging-to-multiple-destinations

S.Lott
I would like only debug and info message in stdout and no warning or error messages.
Dinoboff
+1  A: 

Not necessarily a good idea (it could be confusing to see info and debug messages mixed in with normal output!), but feasible, since you can have multiple handler objects and a custom filter for each of them, in order to pick and choose which log records each handler gets to handle.

Alex Martelli