info to stdout, warning and errors to stderr

This commit is contained in:
Thomas Nagy 2014-01-19 21:28:17 +01:00
parent fa8fed39a0
commit 3498ef6773
1 changed files with 4 additions and 1 deletions

View File

@ -132,7 +132,10 @@ class log_handler(logging.StreamHandler):
def emit(self, record):
# default implementation
try:
record.stream = self.stream = sys.stderr
if record.levelno >= logging.WARNING:
record.stream = self.stream = sys.stderr
else:
record.stream = self.stream = sys.stdout
self.emit_override(record)
self.flush()
except (KeyboardInterrupt, SystemExit):