{"record":{"id":"11b54000e0e58134","repo":"zed-industries/zed","slug":"cannot-set-multiple-max-levels","errorCode":null,"errorMessage":"Cannot set multiple max levels","messagePattern":"Cannot set multiple max levels","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zlog/src/env_config.rs","lineNumber":28,"sourceCode":"    let mut max_level = None;\n    let mut directive_names = Vec::new();\n    let mut directive_levels = Vec::new();\n\n    for directive in filter.split(',') {\n        match directive.split_once('=') {\n            Some((name, level)) => {\n                anyhow::ensure!(!level.contains('='), \"Invalid directive: {directive}\");\n                let level = parse_level(level.trim())?;\n                directive_names.push(name.trim().trim_end_matches(\".rs\").to_string());\n                directive_levels.push(level);\n            }\n            None => {\n                let Ok(level) = parse_level(directive.trim()) else {\n                    directive_names.push(directive.trim().trim_end_matches(\".rs\").to_string());\n                    directive_levels.push(log::LevelFilter::max() /* Enable all levels */);\n                    continue;\n                };\n                anyhow::ensure!(max_level.is_none(), \"Cannot set multiple max levels\");\n                max_level.replace(level);\n            }\n        };\n    }\n\n    Ok(EnvFilter {\n        level_global: max_level,\n        directive_names,\n        directive_levels,\n    })\n}\n\nfn parse_level(level: &str) -> Result<log::LevelFilter> {\n    if level.eq_ignore_ascii_case(\"TRACE\") {\n        return Ok(log::LevelFilter::Trace);\n    }\n    if level.eq_ignore_ascii_case(\"DEBUG\") {\n        return Ok(log::LevelFilter::Debug);","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/zlog/src/env_config.rs#L10-L46","documentation":"Raised in zlog filter parsing: the filter string specified more than one bare (name-less) max level, e.g. 'info,warn'. Only one global max level is allowed; additional directives must be 'name=level' pairs.","triggerScenarios":"Thrown at crates/zlog/src/env_config.rs:28 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove duplicate bare level directives and keep a single global level","Use per-module directives instead of multiple global levels"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}