summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-09 17:00:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-10 17:40:42 +0000
commite4a365098a9550facae9af069d4b58770dabfd91 (patch)
tree027378c83ac6b78786b780bc3d6924e60cc48207
parentb838b8987c81131fab3743e128f87495dbdeafcb (diff)
downloadpoky-e4a365098a9550facae9af069d4b58770dabfd91.tar.gz
poky-e4a365098a9550facae9af069d4b58770dabfd91.tar.bz2
poky-e4a365098a9550facae9af069d4b58770dabfd91.zip
bitbake/knotty: Show summary of warning/error messages shown
Show a summary count of warning/errors messages shown to the user during the build and make it clear when an error exit code is being set. [YOCTO #1540] (Bitbake rev: 9943bad611a974e4d37a00c7a4de1752250370c5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/ui/knotty.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 38acb4743a..0340619dbd 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -105,6 +105,8 @@ def main(server, eventHandler):
cacheprogress = None
shutdown = 0
return_value = 0
+ errors = 0
+ warnings = 0
while True:
try:
event = eventHandler.waitEvent(0.25)
@@ -123,13 +125,15 @@ def main(server, eventHandler):
if isinstance(event, logging.LogRecord):
if event.levelno >= format.ERROR:
+ errors = errors + 1
return_value = 1
+ if event.levelno >= format.WARNING:
+ warnings = warnings + 1
# For "normal" logging conditions, don't show note logs from tasks
# but do show them if the user has changed the default log level to
# include verbose/debug messages
- #if logger.getEffectiveLevel() > format.VERBOSE:
if event.taskpid != 0 and event.levelno <= format.NOTE:
- continue
+ continue
logger.handle(event)
continue
@@ -208,6 +212,7 @@ def main(server, eventHandler):
continue
if isinstance(event, bb.event.NoProvider):
return_value = 1
+ errors = errors + 1
if event._runtime:
r = "R"
else:
@@ -267,4 +272,8 @@ def main(server, eventHandler):
server.runCommand(["stateShutdown"])
shutdown = shutdown + 1
pass
+ if warnings:
+ print("Summary: There were %s WARNING messages shown.\n" % warnings)
+ if return_value:
+ print("Summary: There were %s ERROR messages shown, returning a non-zero exit code.\n" % errors)
return return_value