diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-01-20 09:39:34 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-18 10:24:06 +0000 |
commit | d086fa3aed34a05d52e73c255ca22379149a64a1 (patch) | |
tree | c55f38b6b86b513c0d4b47a01fed47c9db1cb163 /bitbake/lib/toaster/bldcontrol/management | |
parent | f99f2cdd69f1015953a7e9ab07af46dd63e50ad4 (diff) | |
download | poky-d086fa3aed34a05d52e73c255ca22379149a64a1.tar.gz |
bitbake: toasterui: add extra debug and development infos
We update and add logs throughout the code in order to help
with development. The extra logging is turned off by default,
but it can be enabled by using environment variables.
All logging happens through the Python logging facilities.
The toaster UI will save a log of all incoming events if the
TOASTER_EVENTLOG variable is set.
If TOASTER_SQLDEBUG is set all DB queries will be logged.
If TOASTER_DEVEL is set and the django-fresh module is available,
the module is enabled to allow auto-reload of pages when the
source is changed.
(Bitbake rev: 10c27450601b4d24bbb273bd0e053498807d1060)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/management')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py | 2 | ||||
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py index 96d2d51691..55f118cf77 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py | |||
@@ -1,7 +1,7 @@ | |||
1 | from django.core.management.base import NoArgsCommand, CommandError | 1 | from django.core.management.base import NoArgsCommand, CommandError |
2 | from django.db import transaction | 2 | from django.db import transaction |
3 | from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException | 3 | from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException |
4 | from bldcontrol.models import BuildRequest, BuildEnvironment | 4 | from bldcontrol.models import BuildRequest, BuildEnvironment, BRError |
5 | from orm.models import ToasterSetting | 5 | from orm.models import ToasterSetting |
6 | import os | 6 | import os |
7 | 7 | ||
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index 5e253e0efc..56c989c9c9 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | |||
@@ -4,6 +4,9 @@ from orm.models import Build | |||
4 | from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException, BuildSetupException | 4 | from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException, BuildSetupException |
5 | from bldcontrol.models import BuildRequest, BuildEnvironment, BRError | 5 | from bldcontrol.models import BuildRequest, BuildEnvironment, BRError |
6 | import os | 6 | import os |
7 | import logging | ||
8 | |||
9 | logger = logging.getLogger("toaster") | ||
7 | 10 | ||
8 | class Command(NoArgsCommand): | 11 | class Command(NoArgsCommand): |
9 | args = "" | 12 | args = "" |
@@ -32,6 +35,7 @@ class Command(NoArgsCommand): | |||
32 | # select the build environment and the request to build | 35 | # select the build environment and the request to build |
33 | br = self._selectBuildRequest() | 36 | br = self._selectBuildRequest() |
34 | except IndexError as e: | 37 | except IndexError as e: |
38 | # logger.debug("runbuilds: No build request") | ||
35 | return | 39 | return |
36 | try: | 40 | try: |
37 | bec = self._selectBuildEnvironment() | 41 | bec = self._selectBuildEnvironment() |
@@ -39,10 +43,10 @@ class Command(NoArgsCommand): | |||
39 | # we could not find a BEC; postpone the BR | 43 | # we could not find a BEC; postpone the BR |
40 | br.state = BuildRequest.REQ_QUEUED | 44 | br.state = BuildRequest.REQ_QUEUED |
41 | br.save() | 45 | br.save() |
42 | print "No build env" | 46 | logger.debug("runbuilds: No build env") |
43 | return | 47 | return |
44 | 48 | ||
45 | print "Build %s, Environment %s" % (br, bec.be) | 49 | logger.debug("runbuilds: starting build %s, environment %s" % (br, bec.be)) |
46 | # let the build request know where it is being executed | 50 | # let the build request know where it is being executed |
47 | br.environment = bec.be | 51 | br.environment = bec.be |
48 | br.save() | 52 | br.save() |
@@ -63,7 +67,7 @@ class Command(NoArgsCommand): | |||
63 | task = None | 67 | task = None |
64 | bbctrl.build(list(map(lambda x:x.target, br.brtarget_set.all())), task) | 68 | bbctrl.build(list(map(lambda x:x.target, br.brtarget_set.all())), task) |
65 | 69 | ||
66 | print "Build launched, exiting" | 70 | logger.debug("runbuilds: Build launched, exiting") |
67 | # disconnect from the server | 71 | # disconnect from the server |
68 | bbctrl.disconnect() | 72 | bbctrl.disconnect() |
69 | 73 | ||
@@ -71,7 +75,7 @@ class Command(NoArgsCommand): | |||
71 | 75 | ||
72 | 76 | ||
73 | except Exception as e: | 77 | except Exception as e: |
74 | print " EE Error executing shell command\n", e | 78 | logger.error("runbuilds: Error executing shell command %s" % e) |
75 | traceback.print_exc(e) | 79 | traceback.print_exc(e) |
76 | BRError.objects.create(req = br, | 80 | BRError.objects.create(req = br, |
77 | errtype = str(type(e)), | 81 | errtype = str(type(e)), |
@@ -83,6 +87,7 @@ class Command(NoArgsCommand): | |||
83 | bec.be.save() | 87 | bec.be.save() |
84 | 88 | ||
85 | 89 | ||
90 | |||
86 | def cleanup(self): | 91 | def cleanup(self): |
87 | from django.utils import timezone | 92 | from django.utils import timezone |
88 | from datetime import timedelta | 93 | from datetime import timedelta |