aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rossi <alexandre.rossi@gmail.com>2018-11-05 15:16:52 +0100
committerAlexandre Rossi <alexandre.rossi@gmail.com>2018-11-05 15:16:52 +0100
commit6b33af72e844547798077740afb14e20631d0f9f (patch)
treecc271c9898667154e183cbad052d38ca04dcc714
parent877d88f7423de3fec030c1e37b97247a26ba0f3b (diff)
downloadlazygal-6b33af72e844547798077740afb14e20631d0f9f.zip
lazygal-6b33af72e844547798077740afb14e20631d0f9f.tar.bz2
output to stout and not stderr
-rwxr-xr-xlazygal.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lazygal.py b/lazygal.py
index eda0c86..c2ee852 100755
--- a/lazygal.py
+++ b/lazygal.py
@@ -259,7 +259,11 @@ if options.tpl_vars is not None:
logger = logging.getLogger()
logger.setLevel(logging.INFO)
-output_log = lazygal.log.ProgressConsoleHandler()
+if sys.stdout.isatty():
+ logging_handler = lazygal.log.ProgressConsoleHandler
+else:
+ logging_handler = logging.StreamHandler
+output_log = logging_handler(sys.stdout)
output_log.setFormatter(logging.Formatter('%(message)s'))
logger.addHandler(output_log)