Files
bugsink/sentry/eventtypes/base.py
Klaas van Schelven 8d17e7b128 For log messages, demote the msg into the value
and make the type 'Log Message'.
This may just be a matter of personal taste, but I've always found these
messages-as-type super-confusing. I'd rather have some made up (but clear,
and thanks to the whitespace unlikely-to-otherwise-exist) type "Log Message".

This is also inline in what I've already done in the UI.
2024-04-08 14:48:39 +02:00

21 lines
685 B
Python

from sentry.utils.safe import get_path
from sentry.utils.strings import strip
from django.template.defaultfilters import truncatechars
class DefaultEvent:
"""The DefaultEvent is the Event for which there is no exception set. Given the implementation of `get_title`, I'd
actually say that this is basically the LogMessageEvent.
"""
def get_exception_type_and_value(self, data):
message = strip(
get_path(data, "logentry", "message")
or get_path(data, "logentry", "formatted")
)
if message:
return "Log Message", truncatechars(message.splitlines()[0], 100)
return "Log Message", "<no log message>"