diff options
-rw-r--r-- | bitbake/lib/bb/event.py | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index 3827dcfba4..526c41f562 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -149,23 +149,30 @@ def print_ui_queue(): | |||
149 | 149 | ||
150 | # First check to see if we have any proper messages | 150 | # First check to see if we have any proper messages |
151 | msgprint = False | 151 | msgprint = False |
152 | msgerrs = False | ||
153 | |||
154 | # Should we print to stderr? | ||
155 | for event in ui_queue[:]: | ||
156 | if isinstance(event, logging.LogRecord) and event.levelno >= logging.WARNING: | ||
157 | msgerrs = True | ||
158 | break | ||
159 | |||
160 | if msgerrs: | ||
161 | logger.addHandler(stderr) | ||
162 | else: | ||
163 | logger.addHandler(stdout) | ||
164 | |||
152 | for event in ui_queue[:]: | 165 | for event in ui_queue[:]: |
153 | if isinstance(event, logging.LogRecord): | 166 | if isinstance(event, logging.LogRecord): |
154 | if event.levelno > logging.DEBUG: | 167 | if event.levelno > logging.DEBUG: |
155 | if event.levelno >= logging.WARNING: | ||
156 | logger.addHandler(stderr) | ||
157 | else: | ||
158 | logger.addHandler(stdout) | ||
159 | logger.handle(event) | 168 | logger.handle(event) |
160 | msgprint = True | 169 | msgprint = True |
161 | if msgprint: | ||
162 | return | ||
163 | 170 | ||
164 | # Nope, so just print all of the messages we have (including debug messages) | 171 | # Nope, so just print all of the messages we have (including debug messages) |
165 | logger.addHandler(stdout) | 172 | if not msgprint: |
166 | for event in ui_queue[:]: | 173 | for event in ui_queue[:]: |
167 | if isinstance(event, logging.LogRecord): | 174 | if isinstance(event, logging.LogRecord): |
168 | logger.handle(event) | 175 | logger.handle(event) |
169 | 176 | ||
170 | def fire_ui_handlers(event, d): | 177 | def fire_ui_handlers(event, d): |
171 | global _thread_lock | 178 | global _thread_lock |