Skip to content

Logging

reauth.logging

Logging configuration for reauth.

get_logger

get_logger(name: str) -> logging.Logger

Get a logger for a reauth module.

Parameters:

Name Type Description Default
name str

The logger name, typically name.

required

Returns:

Type Description
Logger

A configured logger instance.

configure_logger

configure_logger(
    *,
    level: int = logging.WARNING,
    handler: Handler | None = None,
) -> logging.Logger

Configure the reauth logger with a handler.

This is an optional helper for library users to quickly set up logging. Users can also configure logging manually using standard logging configuration.

Parameters:

Name Type Description Default
level int

The logging level (default: WARNING).

WARNING
handler Handler | None

A logging handler (default: StreamHandler to stderr).

None

Returns:

Type Description
Logger

The configured reauth logger.

Example

from reauth.logging import configure_logger configure_logger(level=logging.DEBUG)