summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-10-04 14:44:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-06 11:42:46 +0100
commit78b02e1845c0b0ccf75b9de6801798ea4340addc (patch)
tree205fb4e1e373f4da6613c46375cd339cb606070d /bitbake/lib/toaster/toastergui/views.py
parent3ac4694fc3b85cf23909d7e2fcc4ae97004ae927 (diff)
downloadpoky-78b02e1845c0b0ccf75b9de6801798ea4340addc.tar.gz
bitbake: toaster: Monitoring - implement Django logging system
(Bitbake rev: 2efb146480ee46c0463d9edb71bf1c03ce15bcf2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rw-r--r--bitbake/lib/toaster/toastergui/views.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 552ff1649b..cc8517ba6c 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -34,6 +34,8 @@ import mimetypes
34 34
35import logging 35import logging
36 36
37from toastermain.logs import log_view_mixin
38
37logger = logging.getLogger("toaster") 39logger = logging.getLogger("toaster")
38 40
39# Project creation and managed build enable 41# Project creation and managed build enable
@@ -56,6 +58,7 @@ class MimeTypeFinder(object):
56 return guessed_type 58 return guessed_type
57 59
58# single point to add global values into the context before rendering 60# single point to add global values into the context before rendering
61@log_view_mixin
59def toaster_render(request, page, context): 62def toaster_render(request, page, context):
60 context['project_enable'] = project_enable 63 context['project_enable'] = project_enable
61 context['project_specific'] = is_project_specific 64 context['project_specific'] = is_project_specific
@@ -665,6 +668,7 @@ def recipe_packages(request, build_id, recipe_id):
665 return response 668 return response
666 669
667from django.http import HttpResponse 670from django.http import HttpResponse
671@log_view_mixin
668def xhr_dirinfo(request, build_id, target_id): 672def xhr_dirinfo(request, build_id, target_id):
669 top = request.GET.get('start', '/') 673 top = request.GET.get('start', '/')
670 return HttpResponse(_get_dir_entries(build_id, target_id, top), content_type = "application/json") 674 return HttpResponse(_get_dir_entries(build_id, target_id, top), content_type = "application/json")
@@ -1612,6 +1616,7 @@ if True:
1612 1616
1613 from django.views.decorators.csrf import csrf_exempt 1617 from django.views.decorators.csrf import csrf_exempt
1614 @csrf_exempt 1618 @csrf_exempt
1619 @log_view_mixin
1615 def xhr_testreleasechange(request, pid): 1620 def xhr_testreleasechange(request, pid):
1616 def response(data): 1621 def response(data):
1617 return HttpResponse(jsonfilter(data), 1622 return HttpResponse(jsonfilter(data),
@@ -1648,6 +1653,7 @@ if True:
1648 except Exception as e: 1653 except Exception as e:
1649 return response({"error": str(e) }) 1654 return response({"error": str(e) })
1650 1655
1656 @log_view_mixin
1651 def xhr_configvaredit(request, pid): 1657 def xhr_configvaredit(request, pid):
1652 try: 1658 try:
1653 prj = Project.objects.get(id = pid) 1659 prj = Project.objects.get(id = pid)
@@ -1726,6 +1732,7 @@ if True:
1726 return HttpResponse(json.dumps({"error":str(e) + "\n" + traceback.format_exc()}), content_type = "application/json") 1732 return HttpResponse(json.dumps({"error":str(e) + "\n" + traceback.format_exc()}), content_type = "application/json")
1727 1733
1728 1734
1735 @log_view_mixin
1729 def customrecipe_download(request, pid, recipe_id): 1736 def customrecipe_download(request, pid, recipe_id):
1730 recipe = get_object_or_404(CustomImageRecipe, pk=recipe_id) 1737 recipe = get_object_or_404(CustomImageRecipe, pk=recipe_id)
1731 1738