API Documentation

python logging extensions

This module contains the basic logging extensions.

class logpp.logging.LogppHandler(level=0)[source]

Bases: logging.Handler, abc.ABC

Extend this class to create handlers specific to LogppMessage messages.

emit(record: logging.LogRecord)[source]

This is the standard logging handler method that will filter out any messages that aren’t LogppMessage instances. When you extend this type of handler, override the LogppHandler.emit_logpp() method.

Parameters

record – the logging record

emit_logpp(msg_: logpp.logging.LogppMessage)[source]

Override this method to handle LogppMessage messages when they are logged.

Parameters

msg – the logpp logging message

class logpp.logging.LogppMessage[source]

Bases: tuple

This is a logging record, suitable to pass on to a logger as the primary logging message.

detail

the message detail object

summary

the message summary

class logpp.logging.LogppMixin[source]

Bases: object

This is a mixin that provides standard access to a logger via the LogppMixin.logger() function.

The name of the logger reflect’s the class name, though you can override that by providing your class with a __loggername__ attribute.

classmethod logger()[source]
logpp.logging.msg(summary: str, detail: Any) → logpp.logging.LogppMessage[source]

Create a logging record.

Parameters
  • summary – the principal summary of the logging event

  • detail – the message detail data object

Returns

a logging record