fix: show log filename if open/creation failed (#1111)

If opening or creating the logfile fails, rustic now shows the filename
to allow users debug the error.

closes #1105
This commit is contained in:
aawsome 2024-03-22 08:21:45 +01:00 committed by GitHub
parent 07f92d882e
commit 0f3cc39264
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -244,7 +244,16 @@ impl Configurable<RusticConfig> for EntryPoint {
WriteLogger::new(
level_filter,
simplelog::Config::default(),
File::options().create(true).append(true).open(file)?,
File::options()
.create(true)
.append(true)
.open(file)
.map_err(|e| {
FrameworkErrorKind::PathError {
name: Some(file.clone()),
}
.context(e)
})?,
),
])
.map_err(|e| FrameworkErrorKind::ConfigError.context(e))?,