mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-30 06:26:38 +00:00
📝 refine library logger entry docs
This commit is contained in:
@@ -3,7 +3,7 @@ name: parse-and-build-library-logger
|
||||
group: api
|
||||
category: facade
|
||||
update-time: 20260613
|
||||
description: Parse JSON logger config text and build the library-facing sync logger facade while intentionally hiding direct runtime helper methods.
|
||||
description: Parse JSON logger config text and build the library-facing sync logger facade by delegating to the configured runtime logger parse-and-build path and then wrapping the result.
|
||||
key-word:
|
||||
- library
|
||||
- facade
|
||||
@@ -13,7 +13,7 @@ key-word:
|
||||
|
||||
## Parse-and-build-library-logger
|
||||
|
||||
Parse raw JSON config text and build a `LibraryLogger[RuntimeSink]` in one step. This facade is the text-driven library counterpart to `parse_and_build_logger(...)`.
|
||||
Parse raw JSON config text and build a `LibraryLogger[RuntimeSink]` in one step. This facade is the text-driven library counterpart to `parse_and_build_logger(...)` plus library-surface narrowing.
|
||||
|
||||
### Interface
|
||||
|
||||
@@ -35,7 +35,8 @@ pub fn parse_and_build_library_logger(
|
||||
|
||||
Detailed rules explaining key parameters and behaviors
|
||||
|
||||
- This API parses config text, validates it, builds the configured logger, and wraps it as a library facade.
|
||||
- This API parses config text, validates it, builds the configured logger through `parse_and_build_logger(...)`, and wraps that same value as a library facade.
|
||||
- The parsed config still goes through the normal configured runtime logger build path, including runtime sink selection, optional queue wrapping, and timestamp application.
|
||||
- The returned facade keeps a narrower surface than the underlying configured logger.
|
||||
- Queue metrics, flush and drain helpers, and file runtime controls stay on the underlying `ConfiguredLogger`, not on the returned facade itself.
|
||||
- `to_logger()` can be used to recover the underlying full logger object when necessary.
|
||||
@@ -68,6 +69,8 @@ ignore(full.pending_count())
|
||||
|
||||
In this example, the caller unwraps the library facade before using configured runtime helper methods.
|
||||
|
||||
And the unwrapped value still reflects the same `RuntimeSink` pipeline built from the parsed config text.
|
||||
|
||||
### Error Case
|
||||
|
||||
e.g.:
|
||||
@@ -82,3 +85,5 @@ e.g.:
|
||||
1. This is the narrow library-oriented parse-and-build sync entry point.
|
||||
|
||||
2. Use `build_library_logger(...)` when the config is already typed.
|
||||
|
||||
3. Use `to_logger()` when internal code later needs configured-runtime helpers or broader logger composition without changing the public facade type.
|
||||
|
||||
Reference in New Issue
Block a user