mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Merge pull request #1673 from safing/fix/tauri-logging
[desktop] Move logging to user dir on windows.
This commit is contained in:
commit
e160dfb091
4 changed files with 2053 additions and 1959 deletions
|
@ -30,6 +30,8 @@
|
|||
"shell:allow-open",
|
||||
"notification:default",
|
||||
"window-state:allow-save-window-state",
|
||||
"window-state:allow-restore-state"
|
||||
"window-state:allow-restore-state",
|
||||
"clipboard-manager:allow-read-text",
|
||||
"clipboard-manager:allow-write-text"
|
||||
]
|
||||
}
|
|
@ -1 +1 @@
|
|||
{"default":{"identifier":"default","description":"Capability for the main window","remote":{"urls":["http://localhost:817"]},"local":true,"windows":["main","splash"],"permissions":["core:path:default","core:event:allow-listen","core:event:allow-unlisten","core:event:allow-emit","core:event:allow-emit-to","core:window:allow-hide","core:window:allow-show","core:window:allow-is-visible","core:window:allow-set-focus","core:window:allow-close","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default","shell:allow-open","notification:default","window-state:allow-save-window-state","window-state:allow-restore-state"]}}
|
||||
{"default":{"identifier":"default","description":"Capability for the main window","remote":{"urls":["http://localhost:817"]},"local":true,"windows":["main","splash"],"permissions":["core:path:default","core:event:allow-listen","core:event:allow-unlisten","core:event:allow-emit","core:event:allow-emit-to","core:window:allow-hide","core:window:allow-show","core:window:allow-is-visible","core:window:allow-set-focus","core:window:allow-close","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default","shell:allow-open","notification:default","window-state:allow-save-window-state","window-state:allow-restore-state","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text"]}}
|
File diff suppressed because it is too large
Load diff
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue