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

login
register
mail settings
Submitter Richard Purdie
Date March 26, 2014, 4:57 p.m.
Message ID <1395853061.24890.108.camel@ted>
Download mbox | patch
Permalink /patch/69331/
State New
Headers show

Comments

Richard Purdie - March 26, 2014, 4:57 p.m.
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@linuxfoundation.org>
---

Patch

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()