Skip to content

logger ¤

Logging functions.

Classes:

  • PluginLogger

    A logger adapter to prefix messages with the originating package name.

Functions:

PluginLogger ¤

PluginLogger(prefix: str, logger: Logger)

Bases: LoggerAdapter

A logger adapter to prefix messages with the originating package name.

Parameters:

  • prefix (str) –

    The string to insert in front of every message.

  • logger (Logger) –

    The logger instance.

Methods:

process ¤

process(
    msg: str, kwargs: MutableMapping[str, Any]
) -> tuple[str, Any]

Process the message.

Parameters:

Returns:

get_logger ¤

get_logger(name: str) -> PluginLogger

Return a logger for plugins.

Parameters:

  • name (str) –

    The name to use with logging.getLogger.

Returns:

  • PluginLogger

    A logger configured to work well in MkDocs, prefixing each message with the plugin package name.