Skip to content

Commit

Permalink
windows: log to %LOCALAPPDATA% instead of Roaming
Browse files Browse the repository at this point in the history
Signed-off-by: Bailey Kasin <[email protected]>
  • Loading branch information
Bailey Kasin committed Oct 15, 2023
1 parent 7bfdea3 commit 80f3275
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::fs;

Check failure on line 1 in src/main.rs

View workflow job for this annotation

GitHub Actions / lint

unused import: `std::fs`

use crate::config::CliConfig;
#[cfg(unix)]
use color_eyre::eyre::eyre;
Expand Down Expand Up @@ -61,10 +63,13 @@ fn setup_logger(log_target: LogTarget, verbose: bool) -> eyre::Result<()> {
#[cfg(target_os = "windows")]
LogTarget::Syslog => {
let dirs = directories::BaseDirs::new().unwrap();
let mut log_file = dirs.config_dir().to_path_buf();
let mut log_file = dirs.data_local_dir().to_path_buf();
log_file.push("spotifyd");
log_file.push(".spotifyd.log");

if let Some(p) = log_file.parent() {
fs::create_dir_all(p)?
};
logger.chain(
std::fs::OpenOptions::new()
.write(true)
Expand Down

0 comments on commit 80f3275

Please sign in to comment.