django-eventlog is a very simple event logger you can use to track certain actions in your code. Events are stored in a Django model and can be viewed in the Django Admin.
MIT License
Full Changelog: https://github.com/bartTC/django-eventlog/compare/v2.0...v2.1
Published by bartTC 8 months ago
Overall test and code refactor.
Documentation now done with MKDocs.
Timeline in Admin change form now supports delays of days and hours, instead of just minutes.
Backwards incompatible: Removed undocumented Event.objects.purge()
queryset method.
Backwards incompatible: The list of event types defined in the app config is now
set via Python dataclasses rather than a dictionary. The migration is straightforward.
event_types = {
"info": {
"label": _("Info"),
"color": None,
"bgcolor": None,
},
"warning": {
"label": _("Warning"),
"color": None,
"bgcolor": None,
},
...
The dictionary is now a EventTypeList
of EventType
dataclasses:
from django.utils.translation import gettext_lazy as _
from eventlog.datastructures import EventType, EventTypeList
# List of event types to be used in events. A list of `EventType` classes
event_types = EventTypeList(
EventType(name="info", label=_("Info")),
EventType(name="warning", label=_("Warning")),
EventType(name="error", label=_("Error"), color="red"),
EventType(name="critical", label=_("Critical"), color="white", bgcolor="red"),
)
You will only need to do this change if you've earlier overridden the event_type property.