How can INFO and DEBUG logging message be sent to stdout and higher level message to stderr

后端 未结 7 971
悲哀的现实
悲哀的现实 2020-12-10 00:32

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 it a good ide

相关标签:
7条回答
  • 2020-12-10 01:26

    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.

    0 讨论(0)
提交回复
热议问题