Add explicit append policy setter

This commit is contained in:
Nanaloveyuki
2026-05-10 12:49:08 +08:00
parent a71471ffb0
commit 0a7af44f06
8 changed files with 41 additions and 3 deletions
+3
View File
@@ -36,6 +36,7 @@ version 0.3.0
- 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 explicit append-policy setter `set_append_mode(...)` / `file_set_append_mode(...)` so append strategy can be updated without piggybacking on `reopen(...)`
- 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
@@ -56,6 +57,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 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
- test: add async logger lifecycle, config roundtrip, and batching/flush policy test seeds
@@ -77,6 +79,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: 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
- docs: update root README and English README with async adapter notes and current scope