diff --git a/plinth/modules/help/help.py b/plinth/modules/help/help.py index 98f711925..16433bc1c 100644 --- a/plinth/modules/help/help.py +++ b/plinth/modules/help/help.py @@ -71,3 +71,14 @@ def manual(request): request, 'help_manual.html', {'title': _('{box_name} Manual').format(box_name=_(cfg.box_name)), 'content': content}) + +def status_logs(request): + X = 100 + file = open(cfg.status_log_file,"r") + data = file.readlines() + data = "".join(data[-X:]) + context = { + "X":X, + "data":data + } + return TemplateResponse(request, "statuslog.html", context) diff --git a/plinth/modules/help/templates/statuslog.html b/plinth/modules/help/templates/statuslog.html new file mode 100644 index 000000000..abc2b68ae --- /dev/null +++ b/plinth/modules/help/templates/statuslog.html @@ -0,0 +1,32 @@ +{% extends 'help_base.html' %} +{% comment %} + # + # This file is part of Plinth. + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU Affero General Public License as + # published by the Free Software Foundation, either version 3 of the + # License, or (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU Affero General Public License for more details. + # + # You should have received a copy of the GNU Affero General Public License + # along with this program. If not,see + . + # +{% endcomment %} + +{% load i18n %} + +{% block content %} + +

+ {% blocktrans trimmed %} + This is the last {{ X }} lines of status log Please attatch with the bug when raising a bug. +

{{ data }}
+ {% endblocktrans %} +

+{% endblock %} \ No newline at end of file diff --git a/plinth/modules/help/urls.py b/plinth/modules/help/urls.py index 52fed0a01..363e0c59f 100644 --- a/plinth/modules/help/urls.py +++ b/plinth/modules/help/urls.py @@ -32,4 +32,5 @@ urlpatterns = [ url(r'^help/index/$', views.index, name='index_explicit'), url(r'^help/about/$', views.about, name='about'), url(r'^help/manual/$', views.manual, name='manual'), + url(r'^help/status-logs',views.status_logs,name='status-logs'), ] diff --git a/plinth/templates/500.html b/plinth/templates/500.html index d78f26832..67f3fa06d 100644 --- a/plinth/templates/500.html +++ b/plinth/templates/500.html @@ -30,6 +30,7 @@ fix. Please report the error on the bug tracker so we can fix it. + Please Attatch the Status Log along with the bug {% endblocktrans %}