mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 15:42:25 +00:00
✨ Add queued file runtime state snapshots
This commit is contained in:
@@ -214,6 +214,7 @@ if native_files_supported() {
|
||||
- `file_sink(...)` also exposes `state()` for reading a single snapshot that includes path, availability, append policy, auto-flush flag, rotation config, and all current failure counters.
|
||||
- `file_sink(...)` also supports `set_auto_flush(...)`, `set_rotation(...)`, and `clear_rotation()` for runtime policy updates.
|
||||
- `ConfiguredLogger` built through `build_logger(...)` also exposes `file_reopen()`, `file_reopen_with_current_policy()`, `file_reopen_append()`, `file_reopen_truncate()`, `file_flush()`, `file_close()`, `file_append_mode()`, `file_path()`, `file_auto_flush()`, `file_rotation_enabled()`, `file_rotation_config()`, `file_state()`, plus `file_set_append_mode(...)`, `file_set_auto_flush(...)`, `file_set_rotation(...)`, `file_clear_rotation()`, and the corresponding file failure counters, so config-driven file logging keeps a usable control surface.
|
||||
- `ConfiguredLogger` also exposes `file_runtime_state()` so queued file loggers can report both the underlying file snapshot and the outer queue backlog/drop state in one read.
|
||||
- `sink.text_formatter.template` currently supports fixed tokens: `{timestamp}`, `{timestamp_ms}`, `{level}`, `{target}`, `{message}`, and `{fields}`.
|
||||
- Config-driven sink assembly currently supports `console`, `json_console`, `text_console`, and `file`.
|
||||
- `queue` remains a synchronous bounded wrapper around the final sink, not an async runtime.
|
||||
|
||||
@@ -40,6 +40,7 @@ version 0.3.0
|
||||
- feat: add explicit `reopen_with_current_policy()` / `file_reopen_with_current_policy()` helpers so stored append-policy reopen is discoverable instead of implicit
|
||||
- feat: add `reopen_append()` / `reopen_truncate()` and configured-logger forwarding helpers so common append-vs-truncate reopen flows do not need raw `Some(true/false)` calls
|
||||
- feat: add `FileSinkState`, `FileSink::state()`, and `file_state()` helpers so file-sink runtime policy and failure counters can be read as one snapshot
|
||||
- feat: add `RuntimeFileState` and `file_runtime_state()` so config-built queued file sinks can expose outer queue backlog/drop state together with inner file state
|
||||
- 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user