Skip to contentSkip to conversation

lib/bb/event: improve handling of event queue on exit

PATCH Applied Paul Eggleton 3 participants 3 messages Sep 11, 2012 – Sep 14, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/bb/event: improve handling of event queue on exit

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.

---
 bitbake/lib/bb/event.py |   12 ++++++++++++
 1 file changed, 12 insertions(+)
bitbake/lib/bb/event.py +12 -0
index fa179d8..ab62d4d 100644
@@ -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)
Signature · 1 line
1.7.9.5
Acked-by Christopher Larson on v1 1/1
#1 lore raw
Quoted 8 lines · Paul Eggleton

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.

+1

This one is biting us, obscuring the useful sanity check messages.

Signature · 1 line
Christopher Larson
#2 lore raw
In reply to Paul Eggleton
Quoted 11 lines · Paul Eggleton

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.

---
 bitbake/lib/bb/event.py |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Merged to master, thanks.

Richard