DataStore Logging
DataStore uses Python's standard logging module. This guide shows how to configure logging for debugging.
Quick Start
Log Levels
| Level | Value | Description |
|---|---|---|
DEBUG | 10 | Detailed information for debugging |
INFO | 20 | General operational information |
WARNING | 30 | Warning messages (default) |
ERROR | 40 | Error messages |
CRITICAL | 50 | Critical failures |
Setting Log Level
Log Format
Simple Format (Default)
Output:
Verbose Format
Output:
What Gets Logged
DEBUG Level
- SQL queries generated
- Execution engine selection
- Cache operations (hits/misses)
- Operation timings
- Data source information
INFO Level
- Major operation completions
- Configuration changes
- Data source connections
WARNING Level
- Deprecated feature usage
- Performance warnings
- Non-critical issues
ERROR Level
- Query execution failures
- Connection errors
- Data conversion errors
Custom Logging Configuration
Using Python Logging
Log to File
Suppress Logging
Debugging Scenarios
Debug SQL Generation
Log output:
Debug Engine Selection
Log output:
Debug Cache Operations
Debug Performance Issues
Log output:
Production Configuration
Recommended Settings
Log Rotation
Environment Variables
You can also configure logging via environment variables:
Summary
| Task | Command |
|---|---|
| Enable debug | config.enable_debug() |
| Set level | config.set_log_level(logging.DEBUG) |
| Set format | config.set_log_format("verbose") |
| Log to file | Use Python logging handlers |
| Suppress logs | config.set_log_level(logging.CRITICAL) |