]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lib/bb/event: improve handling of event queue on exit
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 11 Sep 2012 09:37:22 +0000 (10:37 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Sep 2012 08:28:12 +0000 (09:28 +0100)
If BitBake exits before a UI handler (server) has been registered, we
print the event queue; if there are any errors or other non-debug
messages just print these and suppress the rest of the message queue.

This improves the output when sanity check failures occur with OE-Core
by avoiding printing a long stream of uninformative debug messages.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/event.py

index fa179d8a11f5dcbd6abe1570f4a8f610618cbc35..ab62d4d0555ba4dd1d17750725cbd23049766552 100644 (file)
@@ -104,6 +104,18 @@ def print_ui_queue():
         console = logging.StreamHandler(sys.stdout)
         console.setFormatter(BBLogFormatter("%(levelname)s: %(message)s"))
         logger.handlers = [console]
+
+        # 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:
+                    logger.handle(event)
+                    msgprint = True
+        if msgprint:
+            return
+
+        # Nope, so just print all of the messages we have (including debug messages)
         for event in ui_queue:
             if isinstance(event, logging.LogRecord):
                 logger.handle(event)