Show logentries in the UI

This commit is contained in:
Klaas van Schelven
2023-11-13 18:10:02 +01:00
parent 901306fbbb
commit 92cca690a9
2 changed files with 24 additions and 1 deletions

View File

@@ -49,6 +49,19 @@
{% endfor %}
{% if parsed_data.logentry %}
<h1 class="text-3xl mt-4">{{ parsed_data.logentry.formatted }}</h1>
<div>this is a log entry (I intend to make this clear in some other way)</div>
{% if parsed_data.logger %}
Emitted by {{ parsed_data.logger }}
{% endif %}
{% endif %}
Issue grouper: <span class="font-mono whitespace-pre">"{{ issue_grouper }}"</span>
</div>

View File

@@ -14,7 +14,17 @@ def event_detail(request, pk):
# sentry/glitchtip have some code here to deal with the case that "values" is not present, and exception itself is
# the list of exceptions, but we don't aim for endless backwards compat (yet) so we don't.
exceptions = parsed_data["exception"]["values"]
exceptions = parsed_data["exception"]["values"] if "exception" in parsed_data else None
if parsed_data["logentry"]:
logentry = parsed_data["logentry"]
if "formatted" not in logentry:
# TODO this is just a wild guess"
if "message" in logentry:
if "params" not in logentry:
logentry["formatted"] = logentry["message"]
else:
logentry["formatted"] = logentry["message"].format(logentry["params"])
return render(request, "events/event_detail.html", {
"obj": obj,