📝 refresh runtime file export docs

This commit is contained in:
Nanaloveyuki
2026-06-13 23:37:55 +08:00
parent 06541a578c
commit 56ba583680
6 changed files with 19 additions and 14 deletions
+4 -3
View File
@@ -38,6 +38,7 @@ Detailed rules explaining key parameters and behaviors
- `pretty=true` returns indented JSON for human diagnostics.
- This helper builds on top of `file_sink_state_to_json(...)`.
- The output is well-suited for support dumps, incident reports, and log snapshots.
- Typical inputs come from `FileSink::state()`, `RuntimeSink::file_state()`, or `ConfiguredLogger::file_state()`.
### How to Use
@@ -45,9 +46,9 @@ Here are some specific examples provided.
#### When Need Human-readable File Diagnostics
When file sink status should be printed for operators:
When file runtime status should be printed for operators:
```moonbit
println(stringify_file_sink_state(sink.state(), pretty=true))
println(stringify_file_sink_state(runtime.file_state(), pretty=true))
```
In this example, the full file-state snapshot is rendered in readable JSON.
@@ -56,7 +57,7 @@ In this example, the full file-state snapshot is rendered in readable JSON.
When a snapshot should stay small:
```moonbit
let text = stringify_file_sink_state(sink.state())
let text = stringify_file_sink_state(runtime.file_state())
```
In this example, compact JSON is returned without extra formatting logic.