[bitbake-devel] [PATCH] knotty: Split error output onto stderr

Richard Purdie richard.purdie at linuxfoundation.org
Wed Mar 26 16:57:41 UTC 2014


When using bitbake -e in scripts, it would be helpful if the error
output appeared on stderr, not stdout. This change enables that building
upon the new bb.msg filters.

[YOCTO #5274]

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 31c2dbb..05c3134 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -256,11 +256,15 @@ def main(server, eventHandler, params, tf = TerminalFilter):
     helper = uihelper.BBUIHelper()
 
     console = logging.StreamHandler(sys.stdout)
+    errconsole = logging.StreamHandler(sys.stderr)
     format_str = "%(levelname)s: %(message)s"
     format = bb.msg.BBLogFormatter(format_str)
-    bb.msg.addDefaultlogFilter(console)
+    bb.msg.addDefaultlogFilter(console, bb.msg.BBLogFilterStdOut)
+    bb.msg.addDefaultlogFilter(errconsole, bb.msg.BBLogFilterStdErr)
     console.setFormatter(format)
+    errconsole.setFormatter(format)
     logger.addHandler(console)
+    logger.addHandler(errconsole)
 
     if params.options.remote_server and params.options.kill_server:
         server.terminateServer()





More information about the bitbake-devel mailing list