tools

Utils tools for logging and progress bar.

xrfeitoria.utils.tools.setup_logger(level: Literal['RPC', 'TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO', log_path: PathLike | None = None, replace: bool = True) loguru.Logger[source]

Setup logging to file and console.

Parameters:
  • level (Literal['TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'], optional) –

    logging level. Defaults to ‘INFO’, find more in https://loguru.readthedocs.io/en/stable/api/logger.html. The order of the levels is:

    • ’RPC’ (custom level): logging RPC messages which are sent by RPC protocols.

    • ’TRACE’: logging engine output like console output of blender.

    • ’DEBUG’: logging debug messages.

    • ’INFO’: logging info messages.

  • log_path (Path, optional) – path to save the log file. Defaults to None.

  • replace (bool, optional) – replace the log file if exists. Defaults to True.