log messages appearing twice with Python Logging

后端 未结 8 1399
天命终不由人
天命终不由人 2020-12-04 18:39

I\'m using Python logging, and for some reason, all of my messages are appearing twice.

I have a module to configure logging:

# BUG: It\'s outputting         


        
8条回答
  •  时光说笑
    2020-12-04 19:31

    The handler is added each time you call from outside. Try Removeing the Handler after you finish your job:

    self.logger.removeHandler(ch)
    

提交回复
热议问题