mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
utils: ensure we show error messages on server startup
If a BBHandledException occurs that means some error was logged, so we need to handle any pending events so that we can actually have the error logged. Tinfoil should really be doing this for us but at this stage in the release we can't really fix this there, so do it here for now. Signed-off-by: Paul Eggleton <paul.eggleton@linux.microsoft.com>
This commit is contained in:
parent
38e6288c7d
commit
e01254dd0d
|
@ -205,7 +205,20 @@ def setup_tinfoil(bitbakepath, enable_tracking, loglevel=None):
|
||||||
tinfoil.logger.setLevel(logging.WARNING)
|
tinfoil.logger.setLevel(logging.WARNING)
|
||||||
if loglevel:
|
if loglevel:
|
||||||
tinfoil.logger.setLevel(loglevel)
|
tinfoil.logger.setLevel(loglevel)
|
||||||
|
try:
|
||||||
tinfoil.prepare(config_only = True)
|
tinfoil.prepare(config_only = True)
|
||||||
|
except bb.BBHandledException:
|
||||||
|
sys.exit(1)
|
||||||
|
finally:
|
||||||
|
# Handle any remaining events - needed if server failed and logged errors
|
||||||
|
# FIXME tinfoil.prepare() should really be doing this for us!
|
||||||
|
while True:
|
||||||
|
event = tinfoil.wait_event()
|
||||||
|
if not event:
|
||||||
|
break
|
||||||
|
if isinstance(event, logging.LogRecord):
|
||||||
|
if event.taskpid == 0 or event.levelno > logging.INFO:
|
||||||
|
tinfoil.logger.handle(event)
|
||||||
|
|
||||||
return tinfoil
|
return tinfoil
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user