mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
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.
21 lines
685 B
Python
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>"
|