diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-02-05 13:18:06 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-10 23:07:48 +0000 |
commit | da8110a86ad8b57b8c41873d40aeac346ee66b88 (patch) | |
tree | 0c25d2757da8ed119316af0886ebb64818bdc8cd /bitbake/lib/toaster | |
parent | 0c89846dafa229b5af9653d6e141011c35451825 (diff) | |
download | poky-da8110a86ad8b57b8c41873d40aeac346ee66b88.tar.gz |
bitbake: toaster: improve logging facilities for toaster
This patch improves the logging facilities for toaster in order
to help diagnose bugs that happen on user machines.
The logs are stored now under "/tmp/toaster_$$" where $$ is a
PID-based unique identifier. On shutdown, toaster will automatically
erase all logs unless errors are listed in the log file.
On error, Toaster provides suggestions on what to do.
This patch includes a minor fix found as a result of logging
improvements.
(Bitbake rev: 8a8248f7b7e30469f592e2f8adbf6ce21e8685c5)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | 2 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 2 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 6 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastermain/urls.py | 18 |
4 files changed, 22 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index 3b539b591a..c4ab87bdc9 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | |||
@@ -68,7 +68,7 @@ class Command(NoArgsCommand): | |||
68 | task = None | 68 | task = None |
69 | bbctrl.build(list(map(lambda x:x.target, br.brtarget_set.all())), task) | 69 | bbctrl.build(list(map(lambda x:x.target, br.brtarget_set.all())), task) |
70 | 70 | ||
71 | logger.debug("runbuilds: Build launched, exiting") | 71 | logger.debug("runbuilds: Build launched, exiting. Follow build logs at %s/toaster_ui.log" % bec.be.builddir) |
72 | # disconnect from the server | 72 | # disconnect from the server |
73 | bbctrl.disconnect() | 73 | bbctrl.disconnect() |
74 | 74 | ||
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 7353844bf1..b67a6767b3 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -3248,7 +3248,7 @@ else: | |||
3248 | def xhr_build(request, pid): | 3248 | def xhr_build(request, pid): |
3249 | raise Exception("page not available in interactive mode") | 3249 | raise Exception("page not available in interactive mode") |
3250 | 3250 | ||
3251 | def xhr_projectinfo(request, pid): | 3251 | def xhr_projectinfo(request): |
3252 | raise Exception("page not available in interactive mode") | 3252 | raise Exception("page not available in interactive mode") |
3253 | 3253 | ||
3254 | def xhr_projectedit(request, pid): | 3254 | def xhr_projectedit(request, pid): |
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 7cf905266d..ea7c3534da 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
@@ -344,7 +344,7 @@ LOGGING = { | |||
344 | }, | 344 | }, |
345 | 'formatters': { | 345 | 'formatters': { |
346 | 'datetime': { | 346 | 'datetime': { |
347 | 'format': '%(levelname)s %(asctime)s %(message)s' | 347 | 'format': '%(asctime)s %(levelname)s %(message)s' |
348 | } | 348 | } |
349 | }, | 349 | }, |
350 | 'handlers': { | 350 | 'handlers': { |
@@ -365,8 +365,8 @@ LOGGING = { | |||
365 | 'level': 'DEBUG', | 365 | 'level': 'DEBUG', |
366 | }, | 366 | }, |
367 | 'django.request': { | 367 | 'django.request': { |
368 | 'handlers': ['mail_admins'], | 368 | 'handlers': ['console'], |
369 | 'level': 'ERROR', | 369 | 'level': 'WARN', |
370 | 'propagate': True, | 370 | 'propagate': True, |
371 | }, | 371 | }, |
372 | } | 372 | } |
diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py index 6112067579..f66f11dcde 100644 --- a/bitbake/lib/toaster/toastermain/urls.py +++ b/bitbake/lib/toaster/toastermain/urls.py | |||
@@ -23,6 +23,9 @@ from django.conf.urls import patterns, include, url | |||
23 | from django.views.generic import RedirectView | 23 | from django.views.generic import RedirectView |
24 | from django.views.decorators.cache import never_cache | 24 | from django.views.decorators.cache import never_cache |
25 | 25 | ||
26 | import logging | ||
27 | |||
28 | logger = logging.getLogger("toaster") | ||
26 | 29 | ||
27 | # Uncomment the next two lines to enable the admin: | 30 | # Uncomment the next two lines to enable the admin: |
28 | from django.contrib import admin | 31 | from django.contrib import admin |
@@ -47,10 +50,12 @@ import toastermain.settings | |||
47 | 50 | ||
48 | if toastermain.settings.FRESH_ENABLED: | 51 | if toastermain.settings.FRESH_ENABLED: |
49 | urlpatterns.insert(1, url(r'', include('fresh.urls'))) | 52 | urlpatterns.insert(1, url(r'', include('fresh.urls'))) |
53 | logger.info("Enabled django-fresh extension") | ||
50 | 54 | ||
51 | if toastermain.settings.DEBUG_PANEL_ENABLED: | 55 | if toastermain.settings.DEBUG_PANEL_ENABLED: |
52 | import debug_toolbar | 56 | import debug_toolbar |
53 | urlpatterns.insert(1, url(r'', include(debug_toolbar.urls))) | 57 | urlpatterns.insert(1, url(r'', include(debug_toolbar.urls))) |
58 | logger.info("Enabled django_toolbar extension") | ||
54 | 59 | ||
55 | 60 | ||
56 | if toastermain.settings.MANAGED: | 61 | if toastermain.settings.MANAGED: |
@@ -70,4 +75,15 @@ for t in os.walk(os.path.dirname(currentdir)): | |||
70 | 75 | ||
71 | if "urls.py" in t[2] and t[0] != currentdir: | 76 | if "urls.py" in t[2] and t[0] != currentdir: |
72 | modulename = os.path.basename(t[0]) | 77 | modulename = os.path.basename(t[0]) |
73 | urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls'))) | 78 | # make sure we don't have this module name in |
79 | conflict = False | ||
80 | for p in urlpatterns: | ||
81 | if p.regex.pattern == '^' + modulename + '/': | ||
82 | conflict = True | ||
83 | if not conflict: | ||
84 | urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls'))) | ||
85 | else: | ||
86 | logger.warn("Module \'%s\' has a regexp conflict, was not added to the urlpatterns" % modulename) | ||
87 | |||
88 | from pprint import pformat | ||
89 | logger.debug("urlpatterns list %s", pformat(urlpatterns)) | ||