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:50:34 +0100 |
| commit | 5b53671f270f5ee7edf2acc5a4529c7433fdfc92 (patch) | |
| tree | bb70649cf88a33d5fafefe09bff8e0febf062449 /bitbake/lib | |
| parent | 537dd88c1a86b6a1dd74c29aaa2ecab8213fb1b9 (diff) | |
| download | poky-5b53671f270f5ee7edf2acc5a4529c7433fdfc92.tar.gz | |
bitbake: 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 rev: 8668a94cb1841798636b68fe123400d6b81f6574)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/event.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index fa179d8a11..ab62d4d055 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
| @@ -104,6 +104,18 @@ def print_ui_queue(): | |||
| 104 | console = logging.StreamHandler(sys.stdout) | 104 | console = logging.StreamHandler(sys.stdout) |
| 105 | console.setFormatter(BBLogFormatter("%(levelname)s: %(message)s")) | 105 | console.setFormatter(BBLogFormatter("%(levelname)s: %(message)s")) |
| 106 | logger.handlers = [console] | 106 | logger.handlers = [console] |
| 107 | |||
| 108 | # First check to see if we have any proper messages | ||
| 109 | msgprint = False | ||
| 110 | for event in ui_queue: | ||
| 111 | if isinstance(event, logging.LogRecord): | ||
| 112 | if event.levelno > logging.DEBUG: | ||
| 113 | logger.handle(event) | ||
| 114 | msgprint = True | ||
| 115 | if msgprint: | ||
| 116 | return | ||
| 117 | |||
| 118 | # Nope, so just print all of the messages we have (including debug messages) | ||
| 107 | for event in ui_queue: | 119 | for event in ui_queue: |
| 108 | if isinstance(event, logging.LogRecord): | 120 | if isinstance(event, logging.LogRecord): |
| 109 | logger.handle(event) | 121 | logger.handle(event) |
