CustomRichHandler

class app.util.logging.rich_handler.CustomRichHandler[source]

Bases: RichHandler

Inheritance diagram of CustomRichHandler

Inheritance Diagram for CustomRichHandler

Methods

__init__(*args[, rich_tracebacks, ...])

get_level(record)

get_level_style(record)

get_message_style(record)

render(*args, record, message_renderable, ...)

render_message(record, message)

Render message text in to Text.

should_format(record)

Attributes

__init__(*args, rich_tracebacks: bool = True, show_path: bool = True, show_level: bool = True, level_width: int = 1, level_color_everything: bool = True, level_prefix: str = '[', level_suffix: str = '] ', show_name: bool = True, enable_link_path: bool = False, **kwargs) None[source]
Parameters:
  • rich_tracebacks (bool)

  • show_path (bool)

  • show_level (bool)

  • level_width (int)

  • level_color_everything (bool)

  • level_prefix (str)

  • level_suffix (str)

  • show_name (bool)

  • enable_link_path (bool)

Return type:

None

get_level(record: logging.LogRecord) str[source]
Parameters:

record (logging.LogRecord)

Return type:

str

get_level_style(record: logging.LogRecord) str[source]
Parameters:

record (logging.LogRecord)

Return type:

str

get_message_style(record: logging.LogRecord) str[source]
Parameters:

record (logging.LogRecord)

Return type:

str

render(*args, record: logging.LogRecord, message_renderable: ConsoleRenderable, traceback: Traceback | None, **kwargs) ConsoleRenderable[source]
Parameters:
Return type:

ConsoleRenderable

render_message(record: logging.LogRecord, message: str) ConsoleRenderable[source]

Render message text in to Text.

Parameters:
  • record (LogRecord) – logging Record.

  • message (str) – String containing log message.

Returns:

Renderable to display log message.

Return type:

ConsoleRenderable

should_format(record: logging.LogRecord) bool[source]
Parameters:

record (logging.LogRecord)

Return type:

bool