summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastermain/urls.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-02-05 13:18:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-10 23:07:48 +0000
commitda8110a86ad8b57b8c41873d40aeac346ee66b88 (patch)
tree0c25d2757da8ed119316af0886ebb64818bdc8cd /bitbake/lib/toaster/toastermain/urls.py
parent0c89846dafa229b5af9653d6e141011c35451825 (diff)
downloadpoky-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/toastermain/urls.py')
-rw-r--r--bitbake/lib/toaster/toastermain/urls.py18
1 files changed, 17 insertions, 1 deletions
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
23from django.views.generic import RedirectView 23from django.views.generic import RedirectView
24from django.views.decorators.cache import never_cache 24from django.views.decorators.cache import never_cache
25 25
26import logging
27
28logger = 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:
28from django.contrib import admin 31from django.contrib import admin
@@ -47,10 +50,12 @@ import toastermain.settings
47 50
48if toastermain.settings.FRESH_ENABLED: 51if 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
51if toastermain.settings.DEBUG_PANEL_ENABLED: 55if 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
56if toastermain.settings.MANAGED: 61if 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
88from pprint import pformat
89logger.debug("urlpatterns list %s", pformat(urlpatterns))