summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-09-08 14:02:33 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-15 12:15:07 +0100
commitd649c64bebb0ae756ac65068f5b64262bcfffdd2 (patch)
tree43b8822eaa1ef87570e3bd355d19389c989d79cf /bitbake
parent62c45ffbc7c239b6d50931a0fc46f9a67635b1b1 (diff)
downloadopenembedded-core-contrib-d649c64bebb0ae756ac65068f5b64262bcfffdd2.tar.gz
bitbake: event.py: output errors and warnings to stderr
All logging messages are printed on stdout when processing UI event queue. This makes it impossible to distinguish between errors and normal bitbake output. Output to stderror or stdout depending on log level should fix this. (Bitbake rev: 56ac0d4c7a5f47aeb707b15a0c305d9f73aae945) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/event.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 1f3200e196..42745e241e 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -119,21 +119,28 @@ def print_ui_queue():
logger = logging.getLogger("BitBake")
if not _uiready:
from bb.msg import BBLogFormatter
- console = logging.StreamHandler(sys.stdout)
- console.setFormatter(BBLogFormatter("%(levelname)s: %(message)s"))
- logger.handlers = [console]
+ stdout = logging.StreamHandler(sys.stdout)
+ stderr = logging.StreamHandler(sys.stderr)
+ formatter = BBLogFormatter("%(levelname)s: %(message)s")
+ stdout.setFormatter(formatter)
+ stderr.setFormatter(formatter)
# First check to see if we have any proper messages
msgprint = False
for event in ui_queue:
if isinstance(event, logging.LogRecord):
if event.levelno > logging.DEBUG:
+ if event.levelno >= logging.WARNING:
+ logger.handlers = [stderr]
+ else:
+ logger.handlers = [stdout]
logger.handle(event)
msgprint = True
if msgprint:
return
# Nope, so just print all of the messages we have (including debug messages)
+ logger.handlers = [stdout]
for event in ui_queue:
if isinstance(event, logging.LogRecord):
logger.handle(event)