From 74f1fcf529d573c203a8529758b9aea3e68485ba Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Tue, 1 Oct 2013 20:43:14 +1300 Subject: [PATCH] logging stuff --- core/bot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/bot.py b/core/bot.py index 879a0e2..b3f20d7 100644 --- a/core/bot.py +++ b/core/bot.py @@ -80,10 +80,17 @@ class Bot(object): fh = logging.FileHandler(log_name) fh.setLevel(logging.DEBUG) + # stdout handler + sh = logging.StreamHandler() + sh.setLevel(logging.INFO) + # create a formatter and set the formatter for the handler. frmt = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s') fh.setFormatter(frmt) + simplefrmt = logging.Formatter('[%(levelname)s] %(message)s') + sh.setFormatter(simplefrmt) - # add the Handler to the logger + # add the Handlers to the logger logger.addHandler(fh) + logger.addHandler(sh) return logger