summaryrefslogtreecommitdiffstats
path: root/lib/toaster
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-02-05 13:18:06 +0000
committerAlexandru DAMIAN <alexandru.damian@intel.com>2015-02-09 17:54:34 +0000
commit8a8248f7b7e30469f592e2f8adbf6ce21e8685c5 (patch)
treec3cac8a17fe73dd53e6b41ad3ae05e0126d3270c /lib/toaster
parentc5ddd9d88910857a1b745b1c237df0390dd56835 (diff)
downloadbitbake-contrib-8a8248f7b7e30469f592e2f8adbf6ce21e8685c5.tar.gz
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. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Diffstat (limited to 'lib/toaster')
-rw-r--r--lib/toaster/bldcontrol/management/commands/runbuilds.py2
-rwxr-xr-xlib/toaster/toastergui/views.py2
-rw-r--r--lib/toaster/toastermain/settings.py6
-rw-r--r--lib/toaster/toastermain/urls.py18
4 files changed, 22 insertions, 6 deletions
diff --git a/lib/toaster/bldcontrol/management/commands/runbuilds.py b/lib/toaster/bldcontrol/management/commands/runbuilds.py
index 3b539b591..c4ab87bdc 100644
--- a/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -68,7 +68,7 @@ class Command(NoArgsCommand):
task = None
bbctrl.build(list(map(lambda x:x.target, br.brtarget_set.all())), task)
- logger.debug("runbuilds: Build launched, exiting")
+ logger.debug("runbuilds: Build launched, exiting. Follow build logs at %s/toaster_ui.log" % bec.be.builddir)
# disconnect from the server
bbctrl.disconnect()
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 7353844bf..b67a6767b 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -3248,7 +3248,7 @@ else:
def xhr_build(request, pid):
raise Exception("page not available in interactive mode")
- def xhr_projectinfo(request, pid):
+ def xhr_projectinfo(request):
raise Exception("page not available in interactive mode")
def xhr_projectedit(request, pid):
diff --git a/lib/toaster/toastermain/settings.py b/lib/toaster/toastermain/settings.py
index 7cf905266..ea7c3534d 100644
--- a/lib/toaster/toastermain/settings.py
+++ b/lib/toaster/toastermain/settings.py
@@ -344,7 +344,7 @@ LOGGING = {
},
'formatters': {
'datetime': {
- 'format': '%(levelname)s %(asctime)s %(message)s'
+ 'format': '%(asctime)s %(levelname)s %(message)s'
}
},
'handlers': {
@@ -365,8 +365,8 @@ LOGGING = {
'level': 'DEBUG',
},
'django.request': {
- 'handlers': ['mail_admins'],
- 'level': 'ERROR',
+ 'handlers': ['console'],
+ 'level': 'WARN',
'propagate': True,
},
}
diff --git a/lib/toaster/toastermain/urls.py b/lib/toaster/toastermain/urls.py
index 611206757..f66f11dcd 100644
--- a/lib/toaster/toastermain/urls.py
+++ b/lib/toaster/toastermain/urls.py
@@ -23,6 +23,9 @@ from django.conf.urls import patterns, include, url
from django.views.generic import RedirectView
from django.views.decorators.cache import never_cache
+import logging
+
+logger = logging.getLogger("toaster")
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
@@ -47,10 +50,12 @@ import toastermain.settings
if toastermain.settings.FRESH_ENABLED:
urlpatterns.insert(1, url(r'', include('fresh.urls')))
+ logger.info("Enabled django-fresh extension")
if toastermain.settings.DEBUG_PANEL_ENABLED:
import debug_toolbar
urlpatterns.insert(1, url(r'', include(debug_toolbar.urls)))
+ logger.info("Enabled django_toolbar extension")
if toastermain.settings.MANAGED:
@@ -70,4 +75,15 @@ for t in os.walk(os.path.dirname(currentdir)):
if "urls.py" in t[2] and t[0] != currentdir:
modulename = os.path.basename(t[0])
- urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls')))
+ # make sure we don't have this module name in
+ conflict = False
+ for p in urlpatterns:
+ if p.regex.pattern == '^' + modulename + '/':
+ conflict = True
+ if not conflict:
+ urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls')))
+ else:
+ logger.warn("Module \'%s\' has a regexp conflict, was not added to the urlpatterns" % modulename)
+
+from pprint import pformat
+logger.debug("urlpatterns list %s", pformat(urlpatterns))