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, log_path_level: Literal['RPC', 'TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'] = 'DEBUG', 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.
log_path_level (Literal['RPC', 'TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'], optional) – logging level for the log file. Defaults to ‘DEBUG’.
replace (bool, optional) – replace the log file if exists. Defaults to True.