mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-24 00:42:18 +00:00
📝 consolidate logger API and async lifecycle guidance
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
name: stringify-async-runtime-state
|
||||
group: api
|
||||
category: async
|
||||
update-time: 20260512
|
||||
description: Serialize AsyncRuntimeState into compact or pretty JSON text for diagnostics and startup reporting.
|
||||
update-time: 20260614
|
||||
description: Serialize AsyncRuntimeState into compact or pretty JSON text for diagnostics and startup reporting using the canonical runtime snapshot shape.
|
||||
key-word:
|
||||
- async
|
||||
- state
|
||||
@@ -40,6 +40,8 @@ Detailed rules explaining key parameters and behaviors
|
||||
- `pretty=false` returns compact JSON.
|
||||
- `pretty=true` returns indented JSON for human diagnostics.
|
||||
- This helper is built on top of `async_runtime_state_to_json(...)`.
|
||||
- Internally it serializes the `JsonValue` result with `@json_parser.stringify(...)` or `@json_parser.stringify_pretty(value, 2)`, so the text form stays aligned with the structured runtime-state export helper.
|
||||
- The compact form matches the tested snapshot shape such as `{"mode":"native_worker","background_worker":true}`.
|
||||
- It is well-suited for startup banners, support reports, and target capability logs.
|
||||
|
||||
### How to Use
|
||||
@@ -71,3 +73,11 @@ e.g.:
|
||||
|
||||
- If more complete async logger diagnostics are required, this helper should be replaced with `stringify_async_logger_state(...)`.
|
||||
|
||||
### Notes
|
||||
|
||||
1. The compact output uses the same canonical `mode` labels as `async_runtime_mode_label(...)`.
|
||||
|
||||
2. This helper is the direct text form of the same two-field runtime snapshot exported by `async_runtime_state_to_json(...)`.
|
||||
|
||||
3. Use `async_runtime_state_to_json(...)` when the next consumer still needs a `JsonValue` for composition before final stringification.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user