Add logger config presets

This commit is contained in:
Nanaloveyuki
2026-05-20 10:06:51 +08:00
parent 3c15d8ed13
commit 4c25a81b03
2 changed files with 73 additions and 9 deletions
+4 -1
View File
@@ -47,7 +47,10 @@ pub fn file(
auto_flush~ : Bool = true,
rotation~ : FileRotation? = None,
text_formatter~ : TextFormatterConfig = default_text_formatter_config(),
) -> LoggerConfig {
) -> LoggerConfig raise ConfigError {
if path == "" {
raise ConfigError::InvalidConfig("File sink requires non-empty path")
}
LoggerConfig::new(
min_level=min_level,
target=target,