📝 clarify configured logger alias behavior

This commit is contained in:
Nanaloveyuki
2026-06-14 07:44:01 +08:00
parent 9c1787e700
commit 97feb57cd7
3 changed files with 11 additions and 4 deletions
+2 -1
View File
@@ -35,6 +35,7 @@ Detailed rules explaining key parameters and behaviors
- Parsing and building are done in one step by calling `parse_logger_config_text(input)` first and then passing the resulting `LoggerConfig` into `build_logger(...)`.
- The returned `ConfiguredLogger` is just `Logger[RuntimeSink]`, so it still supports regular logging calls.
- The returned logger also keeps inherited logger target behavior such as `with_target(...)`, `child(...)`, and per-call `target=` overrides on `log(...)`.
- Queue wrapping and file control helpers remain available after config assembly.
- `parse_and_build_application_logger(...)` only re-exports this same configured runtime logger result under the `ApplicationLogger` alias, while `parse_and_build_library_logger(...)` wraps the same result in `LibraryLogger[RuntimeSink]`.
- Errors are surfaced as `ConfigError` rather than silent fallback.
@@ -59,7 +60,7 @@ let logger = parse_and_build_logger(
In this example, config parsing and logger construction happen in one place.
And the resulting value can immediately emit logs.
And the resulting value can immediately emit logs with the same ordinary logger target semantics as any other `Logger` value.
#### When Need Config-built File Or Queue Controls