fietsboek.log module

Logging-related utilities.

class fietsboek.log.LogLine(time, name, level, level_name, message, thread, lineno)

Bases: object

A rendered log line, as it is kept in memory.

as_dict()

Returns the attributes of this log line as a dict.

Return type:

dict

level: int
level_name: str
lineno: int
message: str
name: str
thread: str
time: str
class fietsboek.log.NameLevelFilter(name, level)

Bases: Filter

Filters log records by level, but only if the name matches.

filter(record)

Determine if the specified record is to be logged.

Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.

class fietsboek.log.RingBuffer(maxlen)

Bases: Handler

Stores messages in a ring-buffer.

When the buffer is full, a new message will replace the oldest one.

buffer: deque
emit(record)

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

fietsboek.log.install()

Install the in-memory log handler to the root logger.