Skip to content

expand_log_field

faststream.log.formatter.expand_log_field #

expand_log_field(field, symbols)

Expands a log field by adding spaces.

PARAMETER DESCRIPTION
field

The log field to expand.

TYPE: str

symbols

The desired length of the expanded field.

TYPE: int

RETURNS DESCRIPTION
str

The expanded log field.

Source code in faststream/log/formatter.py
def expand_log_field(field: str, symbols: int) -> str:
    """Expands a log field by adding spaces.

    Args:
        field: The log field to expand.
        symbols: The desired length of the expanded field.

    Returns:
        The expanded log field.
    """
    return field + (" " * (symbols - len(field)))