Commit 52ec779
Add structured logging with trace correlation (Phase 2.2)
- Create logging.rs module with comprehensive structured logging infrastructure
- Add LogLevel enum with 6 levels (Trace through Fatal)
- Implement LogOutput format options (Text, Json, Compact, Pretty)
- Add TraceContext for automatic trace_id/span_id injection
- Create LogConfig with builder pattern and presets (development, production)
- Implement per-module log level filtering
- Add LogEntry with JSON and text formatters
- Create StructuredLogger with multi-sink support
- Implement LogSink trait with ConsoleSink, MemoryLogSink, FileLogSink
- Add global logger functions (init, logger, info, error, etc.)
- Include LoggerStats for monitoring log activity
- Export types in prelude with renamed aliases to avoid conflicts
- Add 14 comprehensive tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 99e206f commit 52ec779
2 files changed
Lines changed: 1305 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
221 | 231 | | |
222 | 232 | | |
223 | 233 | | |
| |||
0 commit comments