mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 15:42:25 +00:00
✨ Add config JSON export helpers
This commit is contained in:
@@ -222,6 +222,7 @@ match logger.file_runtime_state() {
|
||||
## Config Notes
|
||||
|
||||
- BitLogger now includes a JSON config layer via `parse_logger_config_text(...)`, `stringify_logger_config(...)`, and `build_logger(...)`.
|
||||
- `QueueConfig`, `TextFormatterConfig`, and `SinkConfig` can also be exported independently through `queue_config_to_json(...)` / `stringify_queue_config(...)`, `text_formatter_config_to_json(...)` / `stringify_text_formatter_config(...)`, and `sink_config_to_json(...)` / `stringify_sink_config(...)`.
|
||||
- Supported keys include `min_level`, `target`, `timestamp`, `sink.kind`, `sink.path`, `sink.append`, `sink.auto_flush`, `sink.rotation`, `sink.text_formatter`, and `queue`.
|
||||
- `sink.rotation` currently supports `max_bytes` and `max_backups` for basic size-based rotation and backup retention.
|
||||
- `file_sink(...)` also exposes `reopen()`, `reopen_with_current_policy()`, `reopen_append()`, `reopen_truncate()`, `open_failures()`, `write_failures()`, `flush_failures()`, and `rotation_failures()` for basic observability.
|
||||
|
||||
@@ -11,6 +11,7 @@ version 0.3.0
|
||||
- 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 standalone JSON export helpers for `QueueConfig`, `TextFormatterConfig`, and `SinkConfig`
|
||||
- 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: add `bitlogger_async/` as a separate native-target async adapter package
|
||||
@@ -56,6 +57,7 @@ version 0.3.0
|
||||
- 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 stable JSON export for reusable config subtypes
|
||||
- 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
|
||||
@@ -82,6 +84,7 @@ version 0.3.0
|
||||
- docs: add `examples/async_basic` to show async worker startup and queue-backed logging flow
|
||||
- docs: update `examples/async_basic` to use unified JSON-driven async logger config
|
||||
- docs: update root README, English README, and Mooncake README with config usage notes
|
||||
- docs: document standalone JSON export helpers for reusable config subtypes
|
||||
- docs: update formatter examples to demonstrate template-based text rendering
|
||||
- docs: update file sink examples to demonstrate rotation and backup retention
|
||||
- docs: document file sink reopen and observability counters in README variants
|
||||
|
||||
Reference in New Issue
Block a user