Skip to content

vllm.logging_utils

Modules:

Name Description
dump_input
formatter

__all__ module-attribute

__all__ = ['NewLineFormatter']

NewLineFormatter

Bases: Formatter

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

Source code in vllm/logging_utils/formatter.py
class NewLineFormatter(logging.Formatter):
    """Adds logging prefix to newlines to align multi-line messages."""

    def __init__(self, fmt, datefmt=None, style="%"):
        logging.Formatter.__init__(self, fmt, datefmt, style)

    def format(self, record):
        msg = logging.Formatter.format(self, record)
        if record.message != "":
            parts = msg.split(record.message)
            msg = msg.replace("\n", "\r\n" + parts[0])
        return msg

__init__

__init__(fmt, datefmt=None, style='%')
Source code in vllm/logging_utils/formatter.py
def __init__(self, fmt, datefmt=None, style="%"):
    logging.Formatter.__init__(self, fmt, datefmt, style)

format

format(record)
Source code in vllm/logging_utils/formatter.py
def format(self, record):
    msg = logging.Formatter.format(self, record)
    if record.message != "":
        parts = msg.split(record.message)
        msg = msg.replace("\n", "\r\n" + parts[0])
    return msg