{"record":{"id":"dcba10df7c32760d","repo":"zed-industries/zed","slug":"invalid-directive-directive","errorCode":null,"errorMessage":"Invalid directive: {directive}","messagePattern":"Invalid directive: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zlog/src/env_config.rs","lineNumber":17,"sourceCode":"use anyhow::Result;\n\npub struct EnvFilter {\n    pub level_global: Option<log::LevelFilter>,\n    pub directive_names: Vec<String>,\n    pub directive_levels: Vec<log::LevelFilter>,\n}\n\npub fn parse(filter: &str) -> Result<EnvFilter> {\n    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,","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/zlog/src/env_config.rs#L1-L35","documentation":"A ZLOG filter directive of the form name=level=extra contains a second '=', so the level string is malformed and cannot be parsed. The filter string given to zlog's env_config parse is syntactically invalid.","triggerScenarios":"Thrown at crates/zlog/src/env_config.rs:17 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the directive to the form module=level (e.g. 'my_module=debug')","Validate user-supplied filter strings before passing them to parse and surface a clear message"],"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"}