Skip to content

Commit

Permalink
changed log path
Browse files Browse the repository at this point in the history
  • Loading branch information
ehaker1 committed May 29, 2024
1 parent 8fd2a7f commit 42a84b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions common/src/settings/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ pub struct LogSettings {
}
impl Default for LogSettings {
fn default() -> Self {
let xdg_dirs = xdg::BaseDirectories::with_prefix("odilia").expect(
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_data_file("odilia.log")
.expect("unable to place log file");
let log_path = xdg_dirs
.place_state_file("odilia.log")
.expect("unable to place log file");

Self { level: "info".to_owned(), logger: LoggingKind::File(log_path) }
}
Expand Down
4 changes: 2 additions & 2 deletions odilia/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ pub fn init(config: &ApplicationConfig) -> eyre::Result<()> {
//this requires boxing because the types returned by this match block would be incompatible otherwise, since we return different layers depending on what we get from the configuration. It is possible to do it otherwise, hopefully, but for now this and a forced dereference at the end would do
let output_layer = match &config.log.logger {
LoggingKind::File(path) => {
let file = std::fs::File::options()
let file = std::fs::File::options()
.create_new(true)
.write(true)
.open(path)
.with_context(|| {
format!("creating log file '{}'", path.display())
})?;
let fmt =
let fmt =
tracing_subscriber::fmt::layer().with_ansi(false).with_writer(file);
fmt.boxed()
}
Expand Down

0 comments on commit 42a84b9

Please sign in to comment.