Skip to content

Commit

Permalink
don't add multiple logging handlers to the same logger
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Feb 12, 2012
1 parent e82a1e4 commit 314ded8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions master/buildbot/test/util/querylog.py
Expand Up @@ -27,6 +27,8 @@ def emit(self, record):

def log_from_engine(engine):
# add the handler *before* enabling logging, so that no "default" logger
# is added automatically
engine.logger.addHandler(PythonToTwistedHandler())
# is added automatically, but only do so once. This is important since
# logging's loggers are singletons
if not engine.logger.handlers:
engine.logger.addHandler(PythonToTwistedHandler())
engine.echo = True

0 comments on commit 314ded8

Please sign in to comment.