Skip to content

vllm.logging_utils.formatter

Classes:

  • ColoredFormatter –

    Adds ANSI color codes to log levels for terminal output.

  • NewLineFormatter –

    Adds logging prefix to newlines to align multi-line messages.

ColoredFormatter

Bases: NewLineFormatter

Adds ANSI color codes to log levels for terminal output.

This formatter adds colors by injecting them into the format string for static elements (timestamp, filename, line number) and modifying the levelname attribute for dynamic color selection.

NewLineFormatter

Bases: Formatter

Adds logging prefix to newlines to align multi-line messages.