lighthouse.log.context

class lighthouse.log.context.ContextFilter(name='')[source]

Bases: logging.Filter

Simple logging.Filter subclass that adds a program attribute to each LogRecord.

The attribute’s value comes from the “program” class attribute.

Initialize a filter.

Initialize with the name of the logger which, together with its children, will have its events allowed through the filter. If no name is specified, allow every event.

program = None
filter(record)[source]

Sets the program attribute on the record. Always returns True as we’re not actually filtering any records, just enhancing them.