summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-09 17:00:53 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-10 17:40:42 (GMT)
commite4a365098a9550facae9af069d4b58770dabfd91 (patch)
tree027378c83ac6b78786b780bc3d6924e60cc48207
parentb838b8987c81131fab3743e128f87495dbdeafcb (diff)
downloadpoky-e4a365098a9550facae9af069d4b58770dabfd91.tar.gz
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 38acb47..0340619 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -105,6 +105,8 @@ def main(server, eventHandler):
105 cacheprogress = None 105 cacheprogress = None
106 shutdown = 0 106 shutdown = 0
107 return_value = 0 107 return_value = 0
108 errors = 0
109 warnings = 0
108 while True: 110 while True:
109 try: 111 try:
110 event = eventHandler.waitEvent(0.25) 112 event = eventHandler.waitEvent(0.25)
@@ -123,13 +125,15 @@ def main(server, eventHandler):
123 125
124 if isinstance(event, logging.LogRecord): 126 if isinstance(event, logging.LogRecord):
125 if event.levelno >= format.ERROR: 127 if event.levelno >= format.ERROR:
128 errors = errors + 1
126 return_value = 1 129 return_value = 1
130 if event.levelno >= format.WARNING:
131 warnings = warnings + 1
127 # For "normal" logging conditions, don't show note logs from tasks 132 # For "normal" logging conditions, don't show note logs from tasks
128 # but do show them if the user has changed the default log level to 133 # but do show them if the user has changed the default log level to
129 # include verbose/debug messages 134 # include verbose/debug messages
130 #if logger.getEffectiveLevel() > format.VERBOSE:
131 if event.taskpid != 0 and event.levelno <= format.NOTE: 135 if event.taskpid != 0 and event.levelno <= format.NOTE:
132 continue 136 continue
133 logger.handle(event) 137 logger.handle(event)
134 continue 138 continue
135 139
@@ -208,6 +212,7 @@ def main(server, eventHandler):
208 continue 212 continue
209 if isinstance(event, bb.event.NoProvider): 213 if isinstance(event, bb.event.NoProvider):
210 return_value = 1 214 return_value = 1
215 errors = errors + 1
211 if event._runtime: 216 if event._runtime:
212 r = "R" 217 r = "R"
213 else: 218 else:
@@ -267,4 +272,8 @@ def main(server, eventHandler):
267 server.runCommand(["stateShutdown"]) 272 server.runCommand(["stateShutdown"])
268 shutdown = shutdown + 1 273 shutdown = shutdown + 1
269 pass 274 pass
275 if warnings:
276 print("Summary: There were %s WARNING messages shown.\n" % warnings)
277 if return_value:
278 print("Summary: There were %s ERROR messages shown, returning a non-zero exit code.\n" % errors)
270 return return_value 279 return return_value