diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-09-01 16:54:42 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-09-01 16:54:42 +0200 |
commit | 273821a2e97efef2bd38107914638d195ac71c3b (patch) | |
tree | 56d4ef6afa4eb6362275d79d11fc773118c0e0c0 /dpd/main.py | |
parent | f5939de02ada69d2ff4ca28bddc9241dcc5c356c (diff) | |
download | dabmod-273821a2e97efef2bd38107914638d195ac71c3b.tar.gz dabmod-273821a2e97efef2bd38107914638d195ac71c3b.tar.bz2 dabmod-273821a2e97efef2bd38107914638d195ac71c3b.zip |
DPD CE: Log up to INFO to console too
Diffstat (limited to 'dpd/main.py')
-rwxr-xr-x | dpd/main.py | 10 |
1 files changed, 10 insertions, 0 deletions
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 |