logging

Custom logging utilities.

Functions

setup_logging([level, colors, stream, file, ...])

Setup log handling.

Classes

CharacterLevelFilter([name])

Adds logging level as a single character for formatting.

ColorLevelFilter([name])

Adds logging level as a color for formatting.

undertale.logging.setup_logging(level: int = 20, colors: bool = True, stream: bool = True, file: str | None = None, clear: bool = True) None

Setup log handling.

Note: this should only be called once.

Parameters:
  • level – Logging level (from logging module).

  • colors – Enable logging colors (if supported).

  • stream – Enable stream logging.

  • file – If provided, enable file logging to the path provided.

  • clear – Remove all other handlers from the root logger.