Skip to content

RabbitLoggingMixin

faststream.rabbit.shared.logging.RabbitLoggingMixin #

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

Bases: LoggingMixin

A class that extends the LoggingMixin class and adds additional functionality for logging RabbitMQ related information.

METHOD DESCRIPTION
__init__

Initializes the RabbitLoggingMixin object.

_get_log_context

Overrides the _get_log_context method of the LoggingMixin class to include RabbitMQ related context information.

fmt

Returns the log format string.

_setup_log_context

Sets up the log context by updating the maximum lengths of the queue and exchange names.

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Initialize the class.

PARAMETER DESCRIPTION
*args

Variable length argument list

TYPE: Any DEFAULT: ()

logger

Optional logger object

TYPE: Optional[Logger] DEFAULT: access_logger

log_level

Logging level

TYPE: int DEFAULT: INFO

log_fmt

Optional log format

TYPE: Optional[str] DEFAULT: None

**kwargs

Arbitrary keyword arguments

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
None

None

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Source code in faststream/rabbit/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 class.

    Args:
        *args: Variable length argument list
        logger: Optional logger object
        log_level: Logging level
        log_fmt: Optional log format
        **kwargs: Arbitrary keyword arguments

    Returns:
        None
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    super().__init__(
        *args,
        logger=logger,
        log_level=log_level,
        log_fmt=log_fmt,
        **kwargs,
    )
    self._max_queue_len = 4
    self._max_exchange_len = 4

fmt property #

fmt: str

log_level instance-attribute #

log_level = log_level

logger instance-attribute #

logger = logger

Last update: 2023-11-13