Logging
quantum-robot uses standard-library loggers under the qrobot namespace and
never configures handlers implicitly. Applications can use
configure_logging() to opt into a console and/or file-based debug setup.
from pathlib import Path
from qrobot.logger import LoggingConfig, configure_logging
configure_logging(LoggingConfig(level=10, file_path=Path("qrobot-debug.log"), console=True))
quantum-robot logging utilities.
- class qrobot.logger.LoggingConfig(level: int = 20, file_path: Path | None = None, console: bool = True)[source]
Optional application-owned logging configuration for quantum-robot.
- Parameters:
level (int) – Standard-library logging level. Defaults to
logging.INFO.file_path (Path | None) – Optional destination for a rotating debug log. No file is created when omitted.
console (bool) – Whether to emit records to standard output. Defaults to
True.
- qrobot.logger.configure_logging(config: LoggingConfig) Logger[source]
Configure quantum-robot logging explicitly for an application.
Only handlers previously installed by this function are replaced. This keeps repeated setup calls idempotent without changing unrelated logging configuration owned by the application.