Skip to content

NatsLoggingMixin

faststream.nats.shared.logging.NatsLoggingMixin #

NatsLoggingMixin(
    *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 NATS logging mixin.

Initialize the NATS 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/nats/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 NATS 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._max_queue_len = 0
    self._max_stream_len = 0
    self._max_subject_len = 4

fmt property #

fmt: str

log_level instance-attribute #

log_level = log_level

logger instance-attribute #

logger = logger