Commits

Chris Mutel  committed b2048d9

Stop logs propogating to iPython notebook

  • Participants
  • Parent commits 2b62bc6

Comments (0)

Files changed (1)

File bw2data/logs.py

     formatter = logging.Formatter(
         "%(asctime)s %(levelname)s %(lineno)d %(message)s")
     logger = logging.getLogger(name)
+    logger.propagate = False
     logger.setLevel(level)
     handler.setFormatter(formatter)
     logger.addHandler(handler)
     filepath = os.path.join(dirname, "%s.%s.log" % (name, random_string(6)))
     handler = logging.StreamHandler(codecs.open(filepath, "w", "utf-8"))
     logger = logging.getLogger(name)
+    logger.propagate = False
     logger.setLevel(logging.INFO)
     handler.setFormatter(logging.Formatter(u"%(message)s"))
     logger.addHandler(handler)
         os.path.join(config.dir, 'logs', filename),
         maxBytes=50000, encoding='utf-8', backupCount=5)
     logger = logging.getLogger(name)
+    logger.propagate = False
     logger.setLevel(level)
     handler.setFormatter(logging.Formatter('''
 Message type:       %(levelname)s