📝 clarify async text builder docs

This commit is contained in:
Nanaloveyuki
2026-06-14 00:06:05 +08:00
parent 4b5456f646
commit 8196fe27b6
3 changed files with 12 additions and 9 deletions
+4 -3
View File
@@ -2,8 +2,8 @@
name: build-library-async-text-logger
group: api
category: facade
update-time: 20260520
description: Build the library-facing text-console async logger facade from an AsyncLoggerBuildConfig.
update-time: 20260614
description: Build the library-facing text-console async logger facade from an AsyncLoggerBuildConfig using the configured text formatter directly.
key-word:
- library
- async
@@ -36,6 +36,7 @@ pub fn build_library_async_text_logger(
Detailed rules explaining key parameters and behaviors
- This API delegates to `build_async_text_logger(...)` and then wraps the result as `LibraryAsyncLogger`.
- It always produces a concrete `FormattedConsoleSink` from `config.logger.sink.text_formatter` instead of selecting among sink kinds.
- It is useful when library code wants a narrow async facade while preserving a concrete text-console sink type.
- `to_async_logger()` can recover the underlying full async logger if needed.
@@ -60,7 +61,7 @@ In this example, the async text sink shape is preserved under the library facade
### Error Case
e.g.:
- If the embedded logger config does not describe text-console output, the caller should use the broader async facade instead.
- If callers need sink-kind-driven branching such as JSON console or file-backed async output, they should use `build_library_async_logger(...)` instead.
- Normal async lifecycle expectations still apply if the logger is never run.