Skip to content

Logging config

cutana.logging_config

Logging configuration for Cutana.

Configures loguru with rotation and proper formatting.

This module follows loguru best practices for library logging: - Cutana is disabled by default at import (in init.py) - setup_logging() enables cutana and adds handlers for application contexts - Does NOT call logger.remove() without tracking handler IDs - Preserves user-added handlers - Users can disable cutana logs with logger.disable("cutana") - Users can re-enable cutana logs with logger.enable("cutana")

setup_logging(log_level='INFO', log_dir='logs', colorize=True, console_level='WARNING', session_timestamp=None)

Configure logging for Cutana with dual-level logging.

This function adds cutana's logging handlers WITHOUT removing any user-defined handlers. This follows loguru best practices for library logging.

Parameters:

Name Type Description Default
log_level str

Logging level for file output (DEBUG, INFO, WARNING, ERROR, CRITICAL, TRACE)

'INFO'
log_dir str

Directory for log files

'logs'
colorize bool

Whether to enable colorized output

True
console_level str

Logging level for console/notebook output (DEBUG, INFO, WARNING, ERROR, CRITICAL, TRACE)

'WARNING'
session_timestamp Optional[str]

Shared timestamp for consistent naming across processes (optional)

None