Vllm.Logger.VllmLogger (VLLM v0.3.0)

Copy Markdown View Source

Note:

This class is just to provide type information.

We actually patch the methods directly on the [`logging.Logger`][]
instance to avoid conflicting with other libraries such as
`intel_extension_for_pytorch.utils._logger`.

Summary

Functions

Low-level logging routine which creates a LogRecord and then calls

Add the specified filter to this handler.

Add the specified handler to this logger.

Pass a record to all relevant handlers.

Log 'msg % args' with severity 'CRITICAL'.

Log 'msg % args' with severity 'DEBUG'.

As [debug][logging.Logger.debug], but subsequent calls with

Log 'msg % args' with severity 'ERROR'.

Convenience method for logging an ERROR with exception information.

Don't use this method, use critical() instead.

Determine if a record is loggable by consulting all the filters.

Find the stack frame of the caller so that we can note the source

Get a logger which is a descendant to this one.

Logging configuration for vLLM.

Get the effective level for this logger.

Call the handlers for the specified record.

See if this logger has any handlers configured.

Log 'msg % args' with severity 'INFO'.

As [info][logging.Logger.info], but subsequent calls with

Is this logger enabled for level 'level'?

Log 'msg % args' with the integer severity 'level'.

A factory method which can be overridden in subclasses to create

Initialize the logger with a name and an optional level.

Remove the specified filter from this handler.

Remove the specified handler from this logger.

Set the logging level of this logger. level must be an int or a str.

Logging configuration for vLLM.

Log 'msg % args' with severity 'WARNING'.

As [warning][logging.Logger.warning], but subsequent calls with

Types

t()

@opaque t()

Functions

_log(ref, level, msg, args, extra_args, opts \\ [])

@spec _log(SnakeBridge.Ref.t(), term(), term(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Low-level logging routine which creates a LogRecord and then calls

all the handlers of this logger to handle the record.

Parameters

  • level (term())
  • msg (term())
  • args (term())
  • exc_info (term() default: None)
  • extra (term() default: None)
  • stack_info (term() default: False)
  • stacklevel (term() default: 1)

Returns

  • term()

add_filter(ref, filter, opts \\ [])

@spec add_filter(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Add the specified filter to this handler.

Parameters

  • filter (term())

Returns

  • term()

add_handler(ref, hdlr, opts \\ [])

@spec add_handler(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Add the specified handler to this logger.

Parameters

  • hdlr (term())

Returns

  • term()

call_handlers(ref, record, opts \\ [])

@spec call_handlers(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Pass a record to all relevant handlers.

Loop through all handlers for this logger and its parents in the logger hierarchy. If no handler was found, output a one-off error message to sys.stderr. Stop searching up the hierarchy whenever a logger with the "propagate" attribute set to zero is found - that will be the last logger whose handlers are called.

Parameters

  • record (term())

Returns

  • term()

critical(ref, msg, args, opts \\ [])

@spec critical(SnakeBridge.Ref.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Log 'msg % args' with severity 'CRITICAL'.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.critical("Houston, we have a %s", "major disaster", exc_info=True)

Parameters

  • msg (term())
  • args (term())
  • kwargs (term())

Returns

  • term()

debug(ref, msg, args, opts \\ [])

@spec debug(SnakeBridge.Ref.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Log 'msg % args' with severity 'DEBUG'.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.debug("Houston, we have a %s", "thorny problem", exc_info=True)

Parameters

  • msg (term())
  • args (term())
  • kwargs (term())

Returns

  • term()

debug_once(ref, msg, args, opts \\ [])

@spec debug_once(SnakeBridge.Ref.t(), String.t(), [term()], keyword()) ::
  {:ok, nil} | {:error, Snakepit.Error.t()}

As [debug][logging.Logger.debug], but subsequent calls with

the same message are silently dropped.

Parameters

  • msg (String.t())
  • args (term())
  • scope (term() keyword-only default: 'process')

Returns

  • nil

error(ref, msg, args, opts \\ [])

@spec error(SnakeBridge.Ref.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Log 'msg % args' with severity 'ERROR'.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.error("Houston, we have a %s", "major problem", exc_info=True)

Parameters

  • msg (term())
  • args (term())
  • kwargs (term())

Returns

  • term()

exception(ref, msg, args, opts \\ [])

@spec exception(SnakeBridge.Ref.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Convenience method for logging an ERROR with exception information.

Parameters

  • msg (term())
  • args (term())
  • exc_info (term() keyword-only default: True)
  • kwargs (term())

Returns

  • term()

fatal(ref, msg, args, opts \\ [])

@spec fatal(SnakeBridge.Ref.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Don't use this method, use critical() instead.

Parameters

  • msg (term())
  • args (term())
  • kwargs (term())

Returns

  • term()

filter(ref, record, opts \\ [])

@spec filter(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Determine if a record is loggable by consulting all the filters.

The default is to allow the record to be logged; any filter can veto this by returning a false value. If a filter attached to a handler returns a log record instance, then that instance is used in place of the original log record in any further processing of the event by that handler. If a filter returns any other true value, the original log record is used in any further processing of the event by that handler.

If none of the filters return false values, this method returns a log record. If any of the filters return a false value, this method returns a false value.

.. versionchanged:: 3.2

Allow filters to be just callables.

.. versionchanged:: 3.12 Allow filters to return a LogRecord instead of modifying it in place.

Parameters

  • record (term())

Returns

  • term()

find_caller(ref, args, opts \\ [])

@spec find_caller(SnakeBridge.Ref.t(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Find the stack frame of the caller so that we can note the source

file name, line number and function name.

Parameters

  • stack_info (term() default: False)
  • stacklevel (term() default: 1)

Returns

  • term()

get_child(ref, suffix, opts \\ [])

@spec get_child(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Get a logger which is a descendant to this one.

This is a convenience method, such that

logging.getLogger('abc').getChild('def.ghi')

is the same as

logging.getLogger('abc.def.ghi')

It's useful, for example, when the parent logger is named using name rather than a literal string.

Parameters

  • suffix (term())

Returns

  • term()

get_children(ref, opts \\ [])

@spec get_children(
  SnakeBridge.Ref.t(),
  keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}

Logging configuration for vLLM.

Returns

  • term()

get_effective_level(ref, opts \\ [])

@spec get_effective_level(
  SnakeBridge.Ref.t(),
  keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}

Get the effective level for this logger.

Loop through this logger and its parents in the logger hierarchy, looking for a non-zero logging level. Return the first one found.

Returns

  • term()

handle(ref, record, opts \\ [])

@spec handle(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Call the handlers for the specified record.

This method is used for unpickled records received from a socket, as well as those created locally. Logger-level filtering is applied.

Parameters

  • record (term())

Returns

  • term()

has_handlers(ref, opts \\ [])

@spec has_handlers(
  SnakeBridge.Ref.t(),
  keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}

See if this logger has any handlers configured.

Loop through all handlers for this logger and its parents in the logger hierarchy. Return True if a handler was found, else False. Stop searching up the hierarchy whenever a logger with the "propagate" attribute set to zero is found - that will be the last logger which is checked for the existence of handlers.

Returns

  • term()

info(ref, msg, args, opts \\ [])

@spec info(SnakeBridge.Ref.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Log 'msg % args' with severity 'INFO'.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.info("Houston, we have a %s", "notable problem", exc_info=True)

Parameters

  • msg (term())
  • args (term())
  • kwargs (term())

Returns

  • term()

info_once(ref, msg, args, opts \\ [])

@spec info_once(SnakeBridge.Ref.t(), String.t(), [term()], keyword()) ::
  {:ok, nil} | {:error, Snakepit.Error.t()}

As [info][logging.Logger.info], but subsequent calls with

the same message are silently dropped.

Parameters

  • msg (String.t())
  • args (term())
  • scope (term() keyword-only default: 'process')

Returns

  • nil

is_enabled_for(ref, level, opts \\ [])

@spec is_enabled_for(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Is this logger enabled for level 'level'?

Parameters

  • level (term())

Returns

  • term()

log(ref, level, msg, args, opts \\ [])

@spec log(SnakeBridge.Ref.t(), term(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Log 'msg % args' with the integer severity 'level'.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.log(level, "We have a %s", "mysterious problem", exc_info=True)

Parameters

  • level (term())
  • msg (term())
  • args (term())
  • kwargs (term())

Returns

  • term()

make_record(ref, name, level, py_fn, lno, msg, args, exc_info, extra_args, opts \\ [])

@spec make_record(
  SnakeBridge.Ref.t(),
  term(),
  term(),
  term(),
  term(),
  term(),
  term(),
  term(),
  [term()],
  keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}

A factory method which can be overridden in subclasses to create

specialized LogRecords.

Parameters

  • name (term())
  • level (term())
  • py_fn (term())
  • lno (term())
  • msg (term())
  • args (term())
  • exc_info (term())
  • func (term() default: None)
  • extra (term() default: None)
  • sinfo (term() default: None)

Returns

  • term()

manager(ref)

@spec manager(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}

new(name, args, opts \\ [])

@spec new(term(), [term()], keyword()) ::
  {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}

Initialize the logger with a name and an optional level.

Parameters

  • name (term())
  • level (term() default: 0)

remove_filter(ref, filter, opts \\ [])

@spec remove_filter(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Remove the specified filter from this handler.

Parameters

  • filter (term())

Returns

  • term()

remove_handler(ref, hdlr, opts \\ [])

@spec remove_handler(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Remove the specified handler from this logger.

Parameters

  • hdlr (term())

Returns

  • term()

root(ref)

@spec root(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}

set_level(ref, level, opts \\ [])

@spec set_level(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Set the logging level of this logger. level must be an int or a str.

Parameters

  • level (term())

Returns

  • term()

warn(ref, msg, args, opts \\ [])

@spec warn(SnakeBridge.Ref.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Logging configuration for vLLM.

Parameters

  • msg (term())
  • args (term())
  • kwargs (term())

Returns

  • term()

warning(ref, msg, args, opts \\ [])

@spec warning(SnakeBridge.Ref.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Log 'msg % args' with severity 'WARNING'.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.warning("Houston, we have a %s", "bit of a problem", exc_info=True)

Parameters

  • msg (term())
  • args (term())
  • kwargs (term())

Returns

  • term()

warning_once(ref, msg, args, opts \\ [])

@spec warning_once(SnakeBridge.Ref.t(), String.t(), [term()], keyword()) ::
  {:ok, nil} | {:error, Snakepit.Error.t()}

As [warning][logging.Logger.warning], but subsequent calls with

the same message are silently dropped.

Parameters

  • msg (String.t())
  • args (term())
  • scope (term() keyword-only default: 'process')

Returns

  • nil