summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/toasterui.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-07-24 18:20:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-29 13:56:48 +0100
commit7eb3e45a33e6fdd310ba47375f6a4577614cc9c4 (patch)
tree834060e5554d68c24fda9a63a429cb0a72bb06a7 /bitbake/lib/bb/ui/toasterui.py
parent669c07d6022174d01fe5a95b7b0faa9ef86da1e2 (diff)
downloadpoky-7eb3e45a33e6fdd310ba47375f6a4577614cc9c4.tar.gz
bitbake: toasterui: refactor log saving and save out-of-build errors
We refactor log saving to go through only one code path. All logs that happened outside the build (i.e. before build starting) now will be logged to either toaster_ui.log if the build command ran in interactive mode, or to the build request errors if the command ran in managed mode. This enables proper display of error logs in project page. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/toasterui.py')
-rw-r--r--bitbake/lib/bb/ui/toasterui.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index 2f628e9a72..d81b8a989c 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -94,7 +94,6 @@ def main(server, eventHandler, params ):
94 first = True 94 first = True
95 95
96 buildinfohelper = BuildInfoHelper(server, build_history_enabled) 96 buildinfohelper = BuildInfoHelper(server, build_history_enabled)
97 brbe = None
98 97
99 while True: 98 while True:
100 try: 99 try:
@@ -111,7 +110,7 @@ def main(server, eventHandler, params ):
111 helper.eventHandler(event) 110 helper.eventHandler(event)
112 111
113 if isinstance(event, bb.event.BuildStarted): 112 if isinstance(event, bb.event.BuildStarted):
114 brbe = buildinfohelper.store_started_build(event) 113 buildinfohelper.store_started_build(event)
115 114
116 if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)): 115 if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)):
117 buildinfohelper.update_and_store_task(event) 116 buildinfohelper.update_and_store_task(event)
@@ -222,19 +221,18 @@ def main(server, eventHandler, params ):
222 bb.command.CommandExit)): 221 bb.command.CommandExit)):
223 if (isinstance(event, bb.command.CommandFailed)): 222 if (isinstance(event, bb.command.CommandFailed)):
224 event.levelno = format.ERROR 223 event.levelno = format.ERROR
225 event.msg = event.error 224 event.msg = "Command Failed " + event.error
226 event.pathname = "" 225 event.pathname = ""
227 event.lineno = 0 226 event.lineno = 0
228 buildinfohelper.store_log_event(event) 227 buildinfohelper.store_log_event(event)
229 errors += 1 228 errors += 1
230 229
231 buildinfohelper.update_build_information(event, errors, warnings, taskfailures) 230 buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
231 buildinfohelper.close()
232 232
233 233
234 # we start a new build info 234 # we start a new build info
235 if brbe is not None: 235 if buildinfohelper.brbe is not None:
236 br_id, be_id = brbe.split(":")
237 buildinfohelper.store_build_done(br_id, be_id)
238 236
239 print "we are under BuildEnvironment management - after the build, we exit" 237 print "we are under BuildEnvironment management - after the build, we exit"
240 server.terminateServer() 238 server.terminateServer()