mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-29 14:06:34 +00:00
📝 clarify async state snapshot docs
This commit is contained in:
@@ -56,6 +56,7 @@ Detailed rules explaining key parameters and behaviors
|
||||
- The constructed value matches the same public shape used by async logger serializers.
|
||||
- Because `AsyncLoggerState` is only a data snapshot type, this constructor is mainly useful for tests, adapters, and synthetic diagnostics rather than ordinary logger inspection.
|
||||
- Serialization helpers accept any `AsyncLoggerState` value, including hand-built ones from this constructor.
|
||||
- That includes combinations such as `has_failed=true` together with non-zero `pending_count` or a retained `last_error`, which are valid for diagnostic snapshots and test fixtures.
|
||||
|
||||
### How to Use
|
||||
|
||||
@@ -106,6 +107,8 @@ e.g.:
|
||||
|
||||
- If callers manually combine a runtime snapshot, counters, or flush policy that do not actually belong together, the constructor still accepts that synthetic snapshot.
|
||||
|
||||
- This constructor does not apply cleanup semantics such as clearing `last_error` on restart or draining pending records; callers must provide those fields exactly as they want them represented.
|
||||
|
||||
### Notes
|
||||
|
||||
1. Use this helper when code should construct an `AsyncLoggerState` value explicitly.
|
||||
|
||||
Reference in New Issue
Block a user