class documentation

class InvocationIdFormatter(logging.Formatter): (source)

View In Hierarchy

A formatter that annotates records with an invocation ID string.

This only adds invocation_id_str for use in the format string; unlike OFMLogFileFormatter it does not rename uvicorn.error records.

Method format Compute invocation_id_str from the record before formatting.
def format(self, record: logging.LogRecord) -> str: (source) ΒΆ

Compute invocation_id_str from the record before formatting.