objwatch.utils.logger module¶
- objwatch.utils.logger.create_logger(name: str = 'objwatch', output: str | None = None, level: int | str = 10, simple: bool = True) None[source]¶
Create and configure a logger.
- Parameters:
name (
str) – Name of the logger.output (
Optional[str]) – File path for writing logs, must end with ‘.objwatch’ for ObjWatch Log Viewer extension.level (
Union[int, str]) – Logging level (e.g., logging.DEBUG, logging.INFO, “force”).simple (
bool) – Defaults to True, disable simple logging mode with the format “[{time}] [{level}] objwatch: {msg}”.
- objwatch.utils.logger.get_logger() Logger[source]¶
Retrieve the configured logger.
- Returns:
The logger instance.
- Return type:
- objwatch.utils.logger.log_info(msg: str, *args: Any, **kwargs: Any) None[source]¶
Log an informational message or print it if FORCE is enabled.
- Parameters:
msg (
str) – The message to log.*args (
Any) – Variable length argument list.**kwargs (
Any) – Arbitrary keyword arguments.
- objwatch.utils.logger.log_debug(msg: str, *args: Any, **kwargs: Any) None[source]¶
Log a debug message or print it if FORCE is enabled.
- Parameters:
msg (
str) – The message to log.*args (
Any) – Variable length argument list.**kwargs (
Any) – Arbitrary keyword arguments.