create_rich_log_handler

Documentation for eth_defi.coloured_logging.create_rich_log_handler function.

create_rich_log_handler(level, *, stream, simplified_logging=False, coloured_threads=False)

Create a Rich log handler for colour console output.

Rich handles the timestamp and log level columns. We prepend module and thread information to the message so the output keeps the useful shape of the previous formatter while gaining Rich’s colours and highlighting.

Parameters
  • level (int) – Handler log level.

  • stream (TextIO) – Console stream that receives log output.

  • simplified_logging (bool) – Do not add module and thread fields when True.

  • coloured_threads (bool) – Use a stable per-thread colour palette when True.

Returns

Configured Rich handler.

Return type

eth_defi.coloured_logging.EthDefiRichHandler