Skip to content

RedisLoggingMixin

faststream.redis.shared.logging.RedisLoggingMixin #

RedisLoggingMixin(*args: Any, logger: Optional[Logger] = access_logger, log_level: int = logging.INFO, log_fmt: Optional[str] = None, **kwargs: Any)

Bases: LoggingMixin

A class to represent a Redis logging mixin.

Initialize the Redis logging mixin.

PARAMETER DESCRIPTION
*args

The arguments.

TYPE: Any DEFAULT: ()

logger

The logger.

TYPE: Optional[Logger] DEFAULT: access_logger

log_level

The log level.

TYPE: int DEFAULT: INFO

log_fmt

The log format.

TYPE: Optional[str] DEFAULT: None

**kwargs

The keyword arguments.

TYPE: Any DEFAULT: {}

Source code in faststream/redis/shared/logging.py
def __init__(
    self,
    *args: Any,
    logger: Optional[logging.Logger] = access_logger,
    log_level: int = logging.INFO,
    log_fmt: Optional[str] = None,
    **kwargs: Any,
) -> None:
    """Initialize the Redis logging mixin.

    Args:
        *args: The arguments.
        logger: The logger.
        log_level: The log level.
        log_fmt: The log format.
        **kwargs: The keyword arguments.
    """
    super().__init__(
        *args,
        logger=logger,
        log_level=log_level,
        log_fmt=log_fmt,
        **kwargs,
    )
    self._message_id_ln = 15
    self._max_channel_name = 4

fmt property #

fmt: str

log_level instance-attribute #

log_level = log_level

logger instance-attribute #

logger = logger