logmancer.models

Classes

LogEntry(id, timestamp, level, message, ...)

SafeJSONField([verbose_name, name, encoder, ...])

JSONField that automatically sanitizes data

class logmancer.models.SafeJSONField(verbose_name=None, name=None, encoder=None, decoder=None, **kwargs)[source]

JSONField that automatically sanitizes data

get_prep_value(value)[source]

Prepare value for database - sanitize before saving

static make_json_safe(data)[source]

Convert data to JSON-serializable format

class logmancer.models.LogEntry(id, timestamp, level, message, path, method, status_code, user, source, actor_type, meta)[source]
timestamp

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

level

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

message

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

path

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

method

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

status_code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

source

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

actor_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

meta

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_level_info()[source]

Get full level information

get_emoji()[source]

Get emoji for this log level

get_color()[source]

Get color for this log level

exception DoesNotExist
exception MultipleObjectsReturned
exception NotUpdated
get_actor_type_display(*, field=<django.db.models.fields.CharField: actor_type>)
get_level_display(*, field=<django.db.models.fields.CharField: level>)
get_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)
get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
user_id