Overview
The logger module provides a simple, user-friendly logging interface built on the Rich library. It supports color-coded log levels, formatted output, and animated status indicators. Source:docugen/utils/logger.py
DocuGenLogger
Attributes
Rich Console instance used for all output rendering.
Methods
info()
Message to log.
[cyan]INFO[/] {message}
warning()
Warning message to log.
[yellow]WARN[/] {message}
error()
Error message to log.
[red]ERROR[/] {message}
success()
Success message to log.
[green]OK[/] {message}
status()
Status message to display with spinner.
Rich Status context manager with “dots” spinner animation.
with statement for automatic cleanup.
get_logger()
Returns
New
DocuGenLogger instance.Usage Examples
Basic Logging
Status Indicator
In Application Code
Log Level Colors
| Level | Prefix | Color | Use Case |
|---|---|---|---|
info() | INFO | Cyan | General information, progress updates |
warning() | WARN | Yellow | Non-critical issues, deprecations |
error() | ERROR | Red | Failures, exceptions, critical problems |
success() | OK | Green | Successful operations, completions |
Rich Console Features
The logger uses Rich’s Console for:- Color and styling - Automatic terminal color support detection
- Unicode support - Emoji and special characters
- Width detection - Automatic terminal width adaptation
- Status animations - Smooth spinner rendering
Design Notes
- No file output - All logging goes to console only
- Stateless - Each
get_logger()call creates independent instance - Simple API - No log levels, configuration, or filtering
- User-focused - Designed for CLI output, not debugging
Related
- CLI Reference - Uses logger for user feedback
- Gemini Client - Logs API interactions
- Main Module - Application-wide logging
