From 71e73c3999386e929c6cd3887cb39825d9dc983b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Sun, 15 Nov 2015 19:21:35 +0100 Subject: [PATCH] logging --- examples/eventhandler_bot.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/eventhandler_bot.py b/examples/eventhandler_bot.py index 886834841..817f72ae0 100644 --- a/examples/eventhandler_bot.py +++ b/examples/eventhandler_bot.py @@ -14,7 +14,17 @@ import sys from telegram import BotEventHandler from telegram.broadcaster import run_async from time import sleep -import re +import logging +import sys + +root = logging.getLogger() +root.setLevel(logging.INFO) + +ch = logging.StreamHandler(sys.stdout) +ch.setLevel(logging.DEBUG) +formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') +ch.setFormatter(formatter) +root.addHandler(ch) last_chat_id = 0