📝 Polish API doc consistency and scope

This commit is contained in:
Nanaloveyuki
2026-05-12 13:47:04 +08:00
parent c6c153cf53
commit 80f15cd455
24 changed files with 9 additions and 118 deletions
@@ -74,9 +74,3 @@ e.g.:
- If callers want direct text output, they should use `stringify_async_logger_build_config(...)` instead. - If callers want direct text output, they should use `stringify_async_logger_build_config(...)` instead.
### Notes
1. This helper exports complete build settings, not runtime state.
2. It is useful for generated configs, test fixtures, and setup introspection.
-6
View File
@@ -69,9 +69,3 @@ e.g.:
- If callers want direct text output instead of a JSON value, they should use `stringify_async_logger_config(...)` instead. - If callers want direct text output instead of a JSON value, they should use `stringify_async_logger_config(...)` instead.
### Notes
1. This helper exports config data, not runtime counters or failure state.
2. Use it when downstream code expects `JsonValue`.
+1 -2
View File
@@ -3,7 +3,7 @@ name: async-logger-config
group: api group: api
category: async category: async
update-time: 20260512 update-time: 20260512
description: Build the queue, batching, linger, and flush policy config used by async loggers. description: Create the queue, batching, linger, and flush policy config used by async loggers.
key-word: key-word:
- async - async
- config - config
@@ -88,4 +88,3 @@ e.g.:
1. This type controls async runtime behavior, not synchronous queue wrapping. 1. This type controls async runtime behavior, not synchronous queue wrapping.
2. Prefer explicit values for production services so overflow and flush semantics are visible. 2. Prefer explicit values for production services so overflow and flush semantics are visible.
+2 -3
View File
@@ -3,7 +3,7 @@ name: async-logger-state
group: api group: api
category: async category: async
update-time: 20260512 update-time: 20260512
description: Read and serialize a full async logger runtime snapshot including queue counters, lifecycle flags, and runtime mode. description: Read a full async logger runtime snapshot including queue counters, lifecycle flags, and runtime mode.
key-word: key-word:
- async - async
- state - state
@@ -13,7 +13,7 @@ key-word:
## Async-logger-state ## Async-logger-state
Read a complete async logger runtime snapshot and serialize it for diagnostics. This API is the preferred way to export queue backlog, dropped counts, lifecycle status, and runtime mode in startup logs, health endpoints, or failure reports. Read a complete async logger runtime snapshot for diagnostics. This API is the preferred way to inspect queue backlog, dropped counts, lifecycle status, and runtime mode before exporting them through JSON helpers when needed.
### Interface ### Interface
@@ -78,4 +78,3 @@ e.g.:
1. Prefer this API over manually combining `pending_count()`, `dropped_count()`, and runtime-mode helpers. 1. Prefer this API over manually combining `pending_count()`, `dropped_count()`, and runtime-mode helpers.
2. Use `pretty=true` when emitting logs for humans and the compact form for machine-oriented payloads. 2. Use `pretty=true` when emitting logs for humans and the compact form for machine-oriented payloads.
-6
View File
@@ -67,9 +67,3 @@ e.g.:
- If callers need the whole runtime object rather than a string label, use `async_runtime_state()`. - If callers need the whole runtime object rather than a string label, use `async_runtime_state()`.
### Notes
1. Prefer this helper over repeated manual `match` blocks when only a label is needed.
2. The label format is especially useful for JSON and telemetry.
-6
View File
@@ -67,9 +67,3 @@ e.g.:
- If the runtime is in compatibility mode, the helper still serializes normally using the matching mode label. - If the runtime is in compatibility mode, the helper still serializes normally using the matching mode label.
### Notes
1. This helper exports runtime capability state, not logger workload state.
2. Use it with `async_runtime_state()` for a fresh snapshot.
+2 -3
View File
@@ -3,7 +3,7 @@ name: async-runtime-state
group: api group: api
category: async category: async
update-time: 20260512 update-time: 20260512
description: Read and serialize the current backend-specific async runtime mode and worker capability. description: Read the current backend-specific async runtime mode and worker capability.
key-word: key-word:
- async - async
- runtime - runtime
@@ -13,7 +13,7 @@ key-word:
## Async-runtime-state ## Async-runtime-state
Read the current backend-specific async runtime state and serialize it for diagnostics. This API focuses on the environment-level async mode rather than any one logger instance. Read the current backend-specific async runtime state for diagnostics. This API focuses on the environment-level async mode rather than any one logger instance.
### Interface ### Interface
@@ -75,4 +75,3 @@ e.g.:
1. Use this API for environment-level diagnostics. 1. Use this API for environment-level diagnostics.
2. Use `AsyncLogger::state()` for logger-instance diagnostics. 2. Use `AsyncLogger::state()` for logger-instance diagnostics.
-6
View File
@@ -67,9 +67,3 @@ e.g.:
- If some sink options are unused by the chosen sink kind, they still follow the supported config export shape rather than a runtime-only interpretation. - If some sink options are unused by the chosen sink kind, they still follow the supported config export shape rather than a runtime-only interpretation.
### Notes
1. Use this API when you need a JSON value instead of text output.
2. Use `stringify_logger_config(...)` for immediate string output.
+1 -2
View File
@@ -3,7 +3,7 @@ name: logger-config
group: api group: api
category: config category: config
update-time: 20260512 update-time: 20260512
description: Build the main logger configuration object used by config-driven runtime logger assembly. description: Create the main logger configuration object used by config-driven runtime logger assembly.
key-word: key-word:
- logger - logger
- config - config
@@ -88,4 +88,3 @@ e.g.:
1. This is the core typed config object for sync logger assembly. 1. This is the core typed config object for sync logger assembly.
2. Prefer this API when config is generated in code rather than parsed from text. 2. Prefer this API when config is generated in code rather than parsed from text.
-6
View File
@@ -70,9 +70,3 @@ e.g.:
- If callers need richer predicate logic than a simple threshold, `with_filter(...)` should be used instead. - If callers need richer predicate logic than a simple threshold, `with_filter(...)` should be used instead.
### Notes
1. This API is the cheapest built-in severity gate.
2. Use it before adding more complex filtering rules.
-6
View File
@@ -69,9 +69,3 @@ e.g.:
- If callers need direct text output instead of a JSON value, they should use `stringify_queue_config(...)` instead. - If callers need direct text output instead of a JSON value, they should use `stringify_queue_config(...)` instead.
### Notes
1. This helper exports config data, not queue runtime metrics.
2. Use this API when downstream code expects `JsonValue`.
+1 -2
View File
@@ -3,7 +3,7 @@ name: queue-config
group: api group: api
category: config category: config
update-time: 20260512 update-time: 20260512
description: Build a serializable queue wrapper config for configured synchronous loggers. description: Create a serializable queue wrapper config for configured synchronous loggers.
key-word: key-word:
- queue - queue
- config - config
@@ -77,4 +77,3 @@ e.g.:
1. This API is for config-driven queue wrapping, not `bitlogger_async`. 1. This API is for config-driven queue wrapping, not `bitlogger_async`.
2. Use `Logger::with_queue(...)` when you want code-side queue composition instead of config. 2. Use `Logger::with_queue(...)` when you want code-side queue composition instead of config.
-6
View File
@@ -67,9 +67,3 @@ e.g.:
- If file-related fields are unused by the sink kind, they are still exported according to the stable config shape. - If file-related fields are unused by the sink kind, they are still exported according to the stable config shape.
### Notes
1. This API is sink-config export only, not runtime sink inspection.
2. Use `stringify_sink_config(...)` for direct string output.
+1 -2
View File
@@ -3,7 +3,7 @@ name: sink-config
group: api group: api
category: config category: config
update-time: 20260512 update-time: 20260512
description: Build a typed sink configuration for config-driven logger assembly. description: Create a typed sink configuration for config-driven logger assembly.
key-word: key-word:
- sink - sink
- config - config
@@ -91,4 +91,3 @@ e.g.:
1. This type is sink-shape configuration, not the runtime sink itself. 1. This type is sink-shape configuration, not the runtime sink itself.
2. Use `sink_config_to_json(...)` and `stringify_sink_config(...)` for export. 2. Use `sink_config_to_json(...)` and `stringify_sink_config(...)` for export.
@@ -73,9 +73,3 @@ e.g.:
- If only one layer of config is required, this helper may be broader than necessary. - If only one layer of config is required, this helper may be broader than necessary.
### Notes
1. This API exports build config data, not runtime logger diagnostics.
2. Use `pretty=true` for docs, debugging, and support output.
@@ -70,9 +70,3 @@ e.g.:
- If invalid constructor inputs were normalized earlier, the resulting text contains the normalized config values. - If invalid constructor inputs were normalized earlier, the resulting text contains the normalized config values.
### Notes
1. This API is convenient for config snapshots, examples, and tests.
2. Use `pretty=true` when readability matters.
-6
View File
@@ -71,9 +71,3 @@ e.g.:
- If callers need a JSON value instead of text, they should use `async_logger_state_to_json(...)` instead. - If callers need a JSON value instead of text, they should use `async_logger_state_to_json(...)` instead.
### Notes
1. This API is the most convenient direct output path for async logger snapshots.
2. Use `pretty=true` for humans and the default compact mode for machine-oriented logs.
@@ -71,9 +71,3 @@ e.g.:
- If more complete async logger diagnostics are required, this helper should be replaced with `stringify_async_logger_state(...)`. - If more complete async logger diagnostics are required, this helper should be replaced with `stringify_async_logger_state(...)`.
### Notes
1. This API reports runtime capability state only.
2. `pretty=true` is more suitable for humans and support output.
-6
View File
@@ -68,9 +68,3 @@ e.g.:
- If config contains optional `queue=None`, the output omits that section rather than failing. - If config contains optional `queue=None`, the output omits that section rather than failing.
### Notes
1. This API is ideal for generated examples and stored config payloads.
2. Use `pretty=true` when readability matters.
-6
View File
@@ -70,9 +70,3 @@ e.g.:
- If queue policy is too aggressive for workload burst size, serialization still succeeds because this helper only exports config. - If queue policy is too aggressive for workload burst size, serialization still succeeds because this helper only exports config.
### Notes
1. This API is convenient for generated config text and tests.
2. Use `pretty=true` when the output is intended for humans.
-6
View File
@@ -68,9 +68,3 @@ e.g.:
- If optional `rotation` is absent, the serialized sink config simply omits that field. - If optional `rotation` is absent, the serialized sink config simply omits that field.
### Notes
1. This helper is convenient for documentation, examples, and generated config output.
2. Use `pretty=true` when humans are the primary audience.
@@ -73,9 +73,3 @@ e.g.:
- If `style_tags` is empty, the serialized text omits that field rather than forcing an empty object. - If `style_tags` is empty, the serialized text omits that field rather than forcing an empty object.
### Notes
1. This helper is useful for config snapshots, examples, and tests.
2. Use `pretty=true` when readability matters.
@@ -69,9 +69,3 @@ e.g.:
- If callers need immediate text output rather than a JSON value, they should use `stringify_text_formatter_config(...)` instead. - If callers need immediate text output rather than a JSON value, they should use `stringify_text_formatter_config(...)` instead.
### Notes
1. This helper exports formatter configuration, not rendered log output.
2. Use it when downstream code expects `JsonValue`.
+1 -2
View File
@@ -3,7 +3,7 @@ name: text-formatter-config
group: api group: api
category: config category: config
update-time: 20260512 update-time: 20260512
description: Build a serializable formatter config object that bridges JSON config and runtime text formatting. description: Create a serializable formatter config object that bridges JSON config and runtime text formatting.
key-word: key-word:
- formatter - formatter
- config - config
@@ -93,4 +93,3 @@ e.g.:
1. Prefer this API when formatter behavior must be stored, parsed, or serialized. 1. Prefer this API when formatter behavior must be stored, parsed, or serialized.
2. Prefer `text_formatter(...)` when writing direct runtime code without config. 2. Prefer `text_formatter(...)` when writing direct runtime code without config.