diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-09-11 10:37:22 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-14 09:28:12 +0100 |
commit | 8668a94cb1841798636b68fe123400d6b81f6574 (patch) | |
tree | 7d42c2e5ff5c0f8376b936299dfe546afa9f1088 /lib/bb/event.py | |
parent | 6783538884adecd914909a9ab4ca73c27575f3ad (diff) | |
download | bitbake-contrib-8668a94cb1841798636b68fe123400d6b81f6574.tar.gz |
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.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/event.py')
-rw-r--r-- | lib/bb/event.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py index fa179d8a1..ab62d4d05 100644 --- a/lib/bb/event.py +++ b/lib/bb/event.py @@ -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) |