📝 align async state serializer docs

This commit is contained in:
Nanaloveyuki
2026-06-14 07:06:16 +08:00
parent a2b37dfe53
commit 1f3da3e6ba
3 changed files with 9 additions and 0 deletions
+3
View File
@@ -44,6 +44,7 @@ Detailed rules explaining key parameters and behaviors
- The compact form matches snapshots such as `{"runtime":{"mode":"native_worker","background_worker":true},"pending_count":0,...}`.
- String output is convenient for logs, CLI output, and startup diagnostics.
- The serializer does not care whether the input came from a live logger read or a synthetic `AsyncLoggerState::new(...)` call.
- It also preserves mixed diagnostic states exactly as provided, such as a failure flag together with non-zero backlog.
### How to Use
@@ -74,6 +75,8 @@ e.g.:
- If callers need a JSON value instead of text, they should use `async_logger_state_to_json(...)` instead.
- Stringification does not apply cleanup behavior; it only formats the supplied snapshot fields.
### Notes
1. The nested `runtime` section uses the same canonical mode labels as `stringify_async_runtime_state(...)`.