API¶
set_logger()¶
set_logger(
logger,
*,
level=logging.DEBUG,
handler_level=None,
theme="default",
color="auto",
stream=None,
timezone=None,
show_datetime=True,
show_level=True,
show_logger_name=True,
show_lineno=True,
show_message=True,
propagate=None,
disabled=None,
replace_handlers=False,
)
Configures and returns a standard logging.Logger.
logger may be a logger name or an existing logging.Logger instance.
BulletTrainFormatter¶
Formatter that renders the bullet-train log line.
Constructor options mirror the formatting-related options on set_logger():
themecolorstreamtimezoneshow_datetimeshow_levelshow_logger_nameshow_linenoshow_message
IsoDatetimeFormatter¶
Base formatter that provides ISO-8601 timestamp formatting with zoneinfo.
Themes¶
level_emojis is the registry of built-in themes.
get_theme() accepts a theme name or custom level mapping. Custom mappings are merged with the default theme.
Levels¶
LOGGING_UNKNOWN is the package's low custom level for messages below logging.DEBUG.
to_level() normalizes string or numeric levels into the formatter's styled level buckets.