[desktop] Move logging to user dir on windows.
This commit is contained in:
@@ -200,6 +200,7 @@ fn main() {
|
||||
cli.with_notifications = *value;
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let log_target = if let Some(data_dir) = cli.data {
|
||||
tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Folder {
|
||||
path: Path::new(&format!("{}/logs/app2", data_dir)).into(),
|
||||
@@ -209,6 +210,14 @@ fn main() {
|
||||
tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Stdout)
|
||||
};
|
||||
|
||||
// TODO(vladimir): Permission for logs/app2 folder are not guaranteed. Use the default location for now.
|
||||
#[cfg(target_os = "windows")]
|
||||
let log_target = if let Some(data_dir) = cli.data {
|
||||
tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::LogDir { file_name: None })
|
||||
} else {
|
||||
tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Stdout)
|
||||
};
|
||||
|
||||
let mut log_level = LOG_LEVEL;
|
||||
match cli.log.as_ref() {
|
||||
"off" => log_level = LevelFilter::Off,
|
||||
|
||||
Reference in New Issue
Block a user