Skip to content

expand_log_field

faststream.log.formatter.expand_log_field #

expand_log_field(field: str, symbols: int) -> str

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.

Note

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

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.
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    return field + (" " * (symbols - len(field)))

Last update: 2023-11-13