capreolus.utils.loginit

Module Contents

Classes

RepeatFilter

Filter instances are used to perform arbitrary filtering of LogRecords.

Functions

get_logger([name])

Attributes

GLOBAL_LOGGING_CONF

capreolus.utils.loginit.GLOBAL_LOGGING_CONF[source]
class capreolus.utils.loginit.RepeatFilter(logger, maxlevel=logging.DEBUG, max_repeats=5)[source]

Bases: logging.Filter

Filter instances are used to perform arbitrary filtering of LogRecords.

Loggers and Handlers can optionally use Filter instances to filter records as desired. The base filter class only allows events which are below a certain point in the logger hierarchy. For example, a filter initialized with “A.B” will allow events logged by loggers “A.B”, “A.B.C”, “A.B.C.D”, “A.B.D” etc. but not “A.BB”, “B.A.B” etc. If initialized with the empty string, all events are passed.

filter(record)[source]

Determine if the specified record is to be logged.

Is the specified record to be logged? Returns 0 for no, nonzero for yes. If deemed appropriate, the record may be modified in-place.

capreolus.utils.loginit.get_logger(name=None)[source]