Expand description
Logging module for codesearch
Provides centralized logging configuration with:
- Daily log file rotation (via tracing-appender)
- Periodic cleanup of old log files (by age and count)
- Per-database log storage in .codesearch.db/logs/
- Configurable via environment variables
Daily rotation creates files named codesearch.log.YYYY-MM-DD.
Cleanup removes files older than retention_days and enforces max_files.
Structs§
- LogRotation
Config - Log rotation configuration
Enums§
- LogLevel
- Log level configuration
- Logger
Init Result - Result of logger initialization, indicating whether file logging is active
Functions§
- cleanup_
old_ logs - Remove old log files based on retention period and max file count.
- ensure_
log_ dir - Ensure the log directory exists
- get_
log_ dir - Get the log directory path for a given database path
- init_
logger - Initialize the logger with file rotation and optional console output.
- start_
cleanup_ task - Start periodic log cleanup task.