From 273821a2e97efef2bd38107914638d195ac71c3b Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 1 Sep 2017 16:54:42 +0200 Subject: DPD CE: Log up to INFO to console too --- dpd/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dpd/main.py b/dpd/main.py index 8af6700..e5c894a 100755 --- a/dpd/main.py +++ b/dpd/main.py @@ -23,6 +23,16 @@ logging.basicConfig(format='%(asctime)s - %(module)s - %(levelname)s - %(message filemode='w', level=logging.DEBUG) +# also log up to INFO to console +console = logging.StreamHandler() +console.setLevel(logging.INFO) +# set a format which is simpler for console use +formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') +# tell the handler to use this format +console.setFormatter(formatter) +# add the handler to the root logger +logging.getLogger('').addHandler(console) + import traceback import src.Measure as Measure import src.Model as Model -- cgit v1.2.3