From 1bb1ced53820127204aa7adf57510c1cbce55e12 Mon Sep 17 00:00:00 2001 From: Knobibrot Date: Wed, 12 Mar 2025 22:27:40 +0100 Subject: [PATCH] feat(log): enable TargetKind::LogDir on mobile (#2524) * enable log dir on iOS/Android * Create change-pr-2524.md --------- Co-authored-by: Fabian-Lars --- .changes/change-pr-2524.md | 6 ++++++ plugins/log/src/lib.rs | 14 ++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 .changes/change-pr-2524.md diff --git a/.changes/change-pr-2524.md b/.changes/change-pr-2524.md new file mode 100644 index 00000000..a3358b93 --- /dev/null +++ b/.changes/change-pr-2524.md @@ -0,0 +1,6 @@ +--- +"log": patch +"log-js": patch +--- + +enable TargetKind::LogDir on mobile diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index 7cb4a526..9bf784c7 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -159,11 +159,12 @@ pub enum TargetKind { /// /// ### Platform-specific /// - /// |Platform | Value | Example | - /// | ------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------- | - /// | Linux | `$XDG_DATA_HOME/{bundleIdentifier}/logs` or `$HOME/.local/share/{bundleIdentifier}/logs` | `/home/alice/.local/share/com.tauri.dev/logs` | - /// | macOS | `{homeDir}/Library/Logs/{bundleIdentifier}` | `/Users/Alice/Library/Logs/com.tauri.dev` | - /// | Windows | `{FOLDERID_LocalAppData}/{bundleIdentifier}/logs` | `C:\Users\Alice\AppData\Local\com.tauri.dev\logs` | + /// |Platform | Value | Example | + /// | --------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------- | + /// | Linux | `$XDG_DATA_HOME/{bundleIdentifier}/logs` or `$HOME/.local/share/{bundleIdentifier}/logs` | `/home/alice/.local/share/com.tauri.dev/logs` | + /// | macOS/iOS | `{homeDir}/Library/Logs/{bundleIdentifier}` | `/Users/Alice/Library/Logs/com.tauri.dev` | + /// | Windows | `{FOLDERID_LocalAppData}/{bundleIdentifier}/logs` | `C:\Users\Alice\AppData\Local\com.tauri.dev\logs` | + /// | Android | `{ConfigDir}/logs` | `/data/data/com.tauri.dev/files/logs` | LogDir { file_name: Option }, /// Forward logs to the webview (via the `log://log` event). /// @@ -451,9 +452,6 @@ impl Builder { )?)? .into() } - #[cfg(mobile)] - TargetKind::LogDir { .. } => continue, - #[cfg(desktop)] TargetKind::LogDir { file_name } => { let path = app_handle.path().app_log_dir()?; if !path.exists() {