Add file policy snapshot helpers

This commit is contained in:
Nanaloveyuki
2026-05-10 13:24:04 +08:00
parent b1ffd9021b
commit ea19d3b9fd
8 changed files with 85 additions and 0 deletions
+1
View File
@@ -44,6 +44,7 @@ version 0.3.0
- feat: add JSON export helpers for `FileSinkState` and `RuntimeFileState` so runtime file snapshots can be dumped directly for diagnostics
- feat: add `reset_failure_counters()` / `file_reset_failure_counters()` so file failure counters can be cleared after diagnostics or recovery handling
- feat: add `reset_policy()` / `file_reset_policy()` so runtime append, auto-flush, and rotation settings can be restored to their initial defaults
- feat: add `policy()` / `default_policy()` and configured-logger forwarding helpers so current runtime file policy and original defaults can be read explicitly
- 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