{"record":{"id":"6f3daf0e1eb455c3","repo":"tracel-ai/burn","slug":"the-path-to-point-to-a-file","errorCode":null,"errorMessage":"The path '{}' to point to a file.","messagePattern":"The path '(.+?)' to point to a file\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-train/src/learner/application_logger.rs","lineNumber":33,"sourceCode":"    path: PathBuf,\n}\n\nimpl FileApplicationLoggerInstaller {\n    /// Create a new file application logger.\n    pub fn new(path: impl AsRef<Path>) -> Self {\n        Self {\n            path: path.as_ref().to_path_buf(),\n        }\n    }\n}\n\nimpl ApplicationLoggerInstaller for FileApplicationLoggerInstaller {\n    fn install(&self) -> Result<(), String> {\n        let path = Path::new(&self.path);\n        let writer = tracing_appender::rolling::never(\n            path.parent().unwrap_or_else(|| Path::new(\".\")),\n            path.file_name().unwrap_or_else(|| {\n                panic!(\"The path '{}' to point to a file.\", self.path.display())\n            }),\n        );\n        let layer = tracing_subscriber::fmt::layer()\n            .with_ansi(false)\n            .with_writer(writer)\n            .with_filter(LevelFilter::INFO)\n            .with_filter(filter_fn(|m| {\n                if let Some(path) = m.module_path() {\n                    // The wgpu crate is logging too much, so we skip `info` level.\n                    if path.starts_with(\"wgpu\") && *m.level() >= Level::INFO {\n                        return false;\n                    }\n                }\n                true\n            }));\n\n        if registry().with(layer).try_init().is_err() {\n            return Err(\"Failed to install the file logger.\".to_string());","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-train/src/learner/application_logger.rs#L15-L51","documentation":"Guard panic in `FileApplicationLoggerInstaller::install`: the configured log path has no file-name component (e.g., it points at a directory root like `/` or `.`), so `path.file_name()` returns None and `tracing_appender` cannot derive a log file to write to.","triggerScenarios":"Thrown at crates/burn-train/src/learner/application_logger.rs:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a path that includes a file name, e.g. `/var/log/train.log` instead of `/var/log/`","Check the path with `Path::file_name()` before constructing the installer","Create the parent directory first if it does not exist"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}