Logging#
- class PatcherLog[source]#
- static setup_logger(name: str | None = None, level: int | None = 20, debug: bool = False) Logger [source]#
Configures and returns a logger. If the logger is already configured, it ensures no duplicate handlers.
- static setup_child_logger(childName: str, loggerName: str | None = None) Logger [source]#
Setup a child logger for a specified context.
Removed in version 2.0
The
debug
parameter is now handled at CLI entry point. Child loggers with an explicitly set logging level will not respect configuration changes to the root logger.
- static custom_excepthook(exc_type: Type[BaseException], exc_value: BaseException, exc_traceback: TracebackType | None) None [source]#
A custom exception handler for unhandled exceptions.
This method is intended to be assigned to
sys.excepthook
to handle any uncaught exceptions in the application.- Parameters:
exc_type (
Type
ofBaseException
) – The class of the exception raised.exc_value (
BaseException
) – The instance of the exception raised.exc_traceback (
Optional
ofTracebackType
) – The traceback object associated with the exception.
- Return type:
None