From 2205c29c549e60d401bc56aca5a2d5f9c87b192d Mon Sep 17 00:00:00 2001 From: "nathan@archer" Date: Sun, 3 Apr 2016 16:33:50 +0100 Subject: [PATCH] Added debug level console logging. --- wanikaniburned.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wanikaniburned.py b/wanikaniburned.py index de435bf..7fa2d01 100644 --- a/wanikaniburned.py +++ b/wanikaniburned.py @@ -2,6 +2,7 @@ import ujson as json import re from datetime import datetime, timedelta import logging +import sys import flask from flask.ext.login import LoginManager, login_user, login_required, current_user, logout_user, login_fresh, \ @@ -14,11 +15,15 @@ from wtforms.validators import DataRequired logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) +console_handler = logging.StreamHandler(sys.stdout) +console_handler.setLevel(logging.DEBUG) handler = logging.FileHandler('wkburned.log') handler.setLevel(logging.WARN) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') handler.setFormatter(formatter) +console_handler.setFormatter(formatter) logger.addHandler(handler) +logger.addHandler(console_handler) app = flask.Flask(__name__) logger.debug("Configuring application.")