Add file policy JSON export helpers

This commit is contained in:
Nanaloveyuki
2026-05-10 13:41:23 +08:00
parent 0877ab02c7
commit 4b258209e6
6 changed files with 52 additions and 0 deletions
+3
View File
@@ -47,6 +47,7 @@ version 0.3.0
- feat: add `policy()` / `default_policy()` and configured-logger forwarding helpers so current runtime file policy and original defaults can be read explicitly
- feat: add `set_policy()` / `file_set_policy()` so bundled append, auto-flush, and rotation policy can be applied in one runtime operation
- feat: add `policy_matches_default()` / `file_policy_matches_default()` so runtime file policy drift can be checked explicitly
- feat: add `file_sink_policy_to_json(...)` and `stringify_file_sink_policy(...)` so standalone file-policy snapshots can be exported directly as JSON
- feat: add `SplitSink`, `split_sink(...)`, and `split_by_level(...)` for routing records into different sinks by predicate or level
- feat: add `Logger::bind(...)` as an ergonomic context-binding alias and `fields(...)` helper for tuple-based field construction
@@ -67,6 +68,7 @@ version 0.3.0
- test: cover path and auto-flush introspection for direct and config-built file sinks
- test: cover rotation introspection for direct and config-built file sinks with and without configured rotation
- test: cover runtime auto-flush and rotation policy mutation for direct and config-built file sinks
- test: cover standalone file-policy JSON export helpers with and without rotation
- test: cover append-policy setter behavior and confirm subsequent reopen calls inherit the updated append mode
- test: cover split sink predicate routing and level-based routing behavior
- test: cover `bind(...)` context composition and `fields(...)` helper behavior
@@ -89,6 +91,7 @@ version 0.3.0
- docs: document file path and auto-flush introspection helpers
- docs: document rotation introspection helpers for direct and config-built file sinks
- docs: document runtime file-policy setter helpers for direct and config-built file sinks
- docs: document standalone file-policy JSON export helpers alongside file state snapshot exports
- docs: clarify explicit append-policy setter semantics for direct and config-built file sinks
- docs: add split sink examples for level-based routing
- docs: add `bind(...)` examples for reusable context binding