Skip to content

Commit

Permalink
Merge branch 'main' into fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
albertotirla authored May 29, 2024
2 parents 200e435 + f944d9d commit b65f12c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ thiserror = "1.0.37"
zbus.workspace = true
serde_plain.workspace = true
figment = "0.10.15"
xdg.workspace=true
xdg.workspace=true
11 changes: 7 additions & 4 deletions common/src/settings/log.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use std::path::PathBuf;

use serde::{Deserialize, Serialize};
///structure used for all the configurable options related to logging
#[derive(Debug, Serialize, Deserialize)]
#[allow(clippy::module_name_repetitions)]
Expand All @@ -16,10 +16,13 @@ pub struct LogSettings {
}
impl Default for LogSettings {
fn default() -> Self {
let directories=xdg::BaseDirectories::with_prefix("odilia").expect("can't create required directories according to the xdg directory specification");
let log_path = directories
let xdg_dirs = xdg::BaseDirectories::with_prefix("odilia").expect(
"unable to find the odilia config directory according to the xdg dirs specification",
);
let log_path = xdg_dirs
.place_state_file("odilia.log")
.expect("can't place log file");
.expect("unable to place log file");

Self { level: "info".to_owned(), logger: LoggingKind::File(log_path) }
}
}
Expand Down

0 comments on commit b65f12c

Please sign in to comment.