Ver código fonte

Refactor logging setup so it works when disabled.

tags/v0.1^2
Ben Kurtovic 12 anos atrás
pai
commit
004dd0b51e
1 arquivos alterados com 2 adições e 3 exclusões
  1. +2
    -3
      earwigbot/config.py

+ 2
- 3
earwigbot/config.py Ver arquivo

@@ -123,12 +123,11 @@ class BotConfig(object):
logger = logging.getLogger("earwigbot")
logger.handlers = [] # Remove any handlers already attached to us
logger.setLevel(logging.DEBUG)
color_formatter = _BotFormatter(color=True)
formatter = _BotFormatter()

if self.metadata.get("enableLogging"):
hand = logging.handlers.TimedRotatingFileHandler
formatter = _BotFormatter()
color_formatter = _BotFormatter(color=True)

logfile = lambda f: path.join(log_dir, f)

if not path.isdir(log_dir):


Carregando…
Cancelar
Salvar