whiteprints.cli.logs#

Logging configuration for the CLI.

Attributes#

Functions#

configure_logging(, date_format)

Configure Rich logging handler.

Module Contents#

whiteprints.cli.logs.LogLevel: TypeAlias = Literal['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG', 'NOTSET'][source]#
whiteprints.cli.logs.configure_logging(
level: LogLevel,
*,
file: TextIO,
log_format: str = _('[{process}:{thread}] [{pathname}:{funcName}:{lineno}]\n{message}'),
date_format: str = _('[%Y-%m-%dT%H:%M:%S]'),
) None[source]#

Configure Rich logging handler.

Parameters:
  • level (LogLevel) – The logging verbosity level.

  • file (TextIO) – An optional file in which to log.

  • log_format (str) – The log message format.

  • date_format (str) – The log date format.

Return type:

None

Example

>>> import sys
>>>
>>> configure_logging("INFO", file=sys.stderr)
None