瀏覽代碼

Refactor logging setup so it works when disabled.

tags/v0.1^2
Ben Kurtovic 12 年之前
父節點
當前提交
004dd0b51e
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. +2
    -3
      earwigbot/config.py

+ 2
- 3
earwigbot/config.py 查看文件

@@ -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):


Loading…
取消
儲存