Skip to content

Commit 1bb1ced

Browse files
elwereneFabianLars
andauthored
feat(log): enable TargetKind::LogDir on mobile (#2524)
* enable log dir on iOS/Android * Create change-pr-2524.md --------- Co-authored-by: Fabian-Lars <[email protected]>
1 parent 68eb743 commit 1bb1ced

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

.changes/change-pr-2524.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"log": patch
3+
"log-js": patch
4+
---
5+
6+
enable TargetKind::LogDir on mobile

plugins/log/src/lib.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,12 @@ pub enum TargetKind {
159159
///
160160
/// ### Platform-specific
161161
///
162-
/// |Platform | Value | Example |
163-
/// | ------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
164-
/// | Linux | `$XDG_DATA_HOME/{bundleIdentifier}/logs` or `$HOME/.local/share/{bundleIdentifier}/logs` | `/home/alice/.local/share/com.tauri.dev/logs` |
165-
/// | macOS | `{homeDir}/Library/Logs/{bundleIdentifier}` | `/Users/Alice/Library/Logs/com.tauri.dev` |
166-
/// | Windows | `{FOLDERID_LocalAppData}/{bundleIdentifier}/logs` | `C:\Users\Alice\AppData\Local\com.tauri.dev\logs` |
162+
/// |Platform | Value | Example |
163+
/// | --------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
164+
/// | Linux | `$XDG_DATA_HOME/{bundleIdentifier}/logs` or `$HOME/.local/share/{bundleIdentifier}/logs` | `/home/alice/.local/share/com.tauri.dev/logs` |
165+
/// | macOS/iOS | `{homeDir}/Library/Logs/{bundleIdentifier}` | `/Users/Alice/Library/Logs/com.tauri.dev` |
166+
/// | Windows | `{FOLDERID_LocalAppData}/{bundleIdentifier}/logs` | `C:\Users\Alice\AppData\Local\com.tauri.dev\logs` |
167+
/// | Android | `{ConfigDir}/logs` | `/data/data/com.tauri.dev/files/logs` |
167168
LogDir { file_name: Option<String> },
168169
/// Forward logs to the webview (via the `log://log` event).
169170
///
@@ -451,9 +452,6 @@ impl Builder {
451452
)?)?
452453
.into()
453454
}
454-
#[cfg(mobile)]
455-
TargetKind::LogDir { .. } => continue,
456-
#[cfg(desktop)]
457455
TargetKind::LogDir { file_name } => {
458456
let path = app_handle.path().app_log_dir()?;
459457
if !path.exists() {

0 commit comments

Comments
 (0)