Add runtime file policy setters

This commit is contained in:
Nanaloveyuki
2026-05-10 12:45:50 +08:00
parent 14eaf9e178
commit a71471ffb0
8 changed files with 133 additions and 12 deletions
+3
View File
@@ -35,6 +35,7 @@ version 0.3.0
- feat: make file append mode queryable via `append_mode()` / `file_append_mode()` and persist explicit `reopen(append=...)` mode updates for later reopen calls
- feat: add `path()` / `auto_flush_enabled()` on `FileSink` and `file_path()` / `file_auto_flush()` on `ConfiguredLogger` for basic file-policy introspection
- feat: add `rotation_enabled()` / `rotation_config()` on `FileSink` and `file_rotation_enabled()` / `file_rotation_config()` on `ConfiguredLogger` for rotation-policy introspection
- feat: add runtime file-policy mutators `set_auto_flush(...)`, `set_rotation(...)`, `clear_rotation()` and corresponding configured-logger forwarding helpers
- 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
@@ -54,6 +55,7 @@ version 0.3.0
- test: cover append-mode observability and reopen-mode persistence for direct and config-built file sinks
- 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 split sink predicate routing and level-based routing behavior
- test: cover `bind(...)` context composition and `fields(...)` helper behavior
- test: add async logger lifecycle, config roundtrip, and batching/flush policy test seeds
@@ -74,6 +76,7 @@ version 0.3.0
- docs: clarify append-mode observability and reopen append-policy semantics
- 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: add split sink examples for level-based routing
- docs: add `bind(...)` examples for reusable context binding
- docs: update root README and English README with async adapter notes and current scope