mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 15:42:25 +00:00
📝 Document config-driven logger usage and 0.3 changes
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
## BitLogger Update Changes
|
||||
|
||||
version 0.3.0
|
||||
|
||||
### Feature
|
||||
|
||||
- feat: add `config.mbt` as a minimal JSON-backed logger configuration layer
|
||||
- feat: add `TextFormatterConfig`, `QueueConfig`, and `LoggerConfig` public config types
|
||||
- feat: add `TextFormatterConfig::new(...)`, `QueueConfig::new(...)`, and `LoggerConfig::new(...)` constructors for explicit config assembly
|
||||
- feat: add `SinkKind` and `SinkConfig` for sink-specific configuration
|
||||
- feat: add `TextFormatterConfig::to_formatter()` for bridging parsed config into runtime formatter setup
|
||||
- feat: add `parse_logger_config_text(...)` for JSON config parsing
|
||||
- feat: add `logger_config_to_json(...)` and `stringify_logger_config(...)` for config serialization
|
||||
- feat: add `RuntimeSink`, `ConfiguredLogger`, `build_logger(...)`, and `parse_and_build_logger(...)` for config-driven logger assembly
|
||||
- feat: add `ConfiguredLogger::drain(...)`, `ConfiguredLogger::pending_count()`, and `ConfiguredLogger::dropped_count()` queue observability helpers
|
||||
- feat: support config keys `min_level`, `target`, `timestamp`, `sink.kind`, `sink.path`, `sink.append`, `sink.auto_flush`, `sink.text_formatter`, and `queue`
|
||||
- feat: support config-driven sink assembly for `console`, `json_console`, `text_console`, and `file`
|
||||
- feat: use `maria/json_parser` as the first external dependency for practical config loading
|
||||
|
||||
### Test
|
||||
|
||||
- test: cover parsing of core logger config fields
|
||||
- test: cover nested formatter and queue config parsing
|
||||
- test: cover config stringify and parse roundtrip behavior
|
||||
- test: cover config-built queued text logger flushing and pending count behavior
|
||||
- test: cover partial drain behavior for config-built queued logger
|
||||
- test: cover dropped-count reporting for bounded config-built queue
|
||||
|
||||
### Example
|
||||
|
||||
- docs: update `examples/basic` with JSON config loading example
|
||||
- docs: update `examples/basic` to use `parse_and_build_logger(...)` with explicit error handling in `main`
|
||||
- docs: update root README, English README, and Mooncake README with config usage notes
|
||||
- chore: ignore local `.mooncakes/` cache directory in git
|
||||
|
||||
### Notes
|
||||
|
||||
- current config scope is still intentionally constrained to stable built-in sink shapes
|
||||
- queue wrapping remains synchronous drain-based delivery, not async runtime scheduling
|
||||
Reference in New Issue
Block a user