1.6 KiB
name, group, category, update-time, description, key-word
| name | group | category | update-time | description | key-word | ||||
|---|---|---|---|---|---|---|---|---|---|
| default-logger-config | api | config | 20260520 | Create the default LoggerConfig used by config-driven logger builders. |
|
Default-logger-config
Create the default LoggerConfig used by config-driven logger builders. This helper is useful when callers want the library's baseline top-level config value explicitly before customization.
Interface
pub fn default_logger_config() -> LoggerConfig {
output
LoggerConfig- Default top-level logger config.
Explanation
Detailed rules explaining key parameters and behaviors
- This helper returns the same baseline config shape used by
LoggerConfig::new()defaults. - It includes the default minimum level, empty target, disabled timestamp, default sink config, and no queue wrapper.
- It is useful for explicit config composition when callers want a known baseline object.
How to Use
Here are some specific examples provided.
When Need A Baseline Top-level Config Value
When config code prefers to start from the full default object:
let config = default_logger_config()
In this example, the default logger config is available as a concrete value for later adjustment or serialization.
Error Case
e.g.:
-
There is no failure path for retrieving the default config value.
-
If runtime construction is needed immediately, pass the config to
build_logger(...)or use a runtime logger constructor directly.
Notes
-
This helper is the top-level default config entry point.
-
It is useful for explicit config-first workflows and tests.