feat(log): enable TargetKind::LogDir on mobile (#2524)

* enable log dir on iOS/Android

* Create change-pr-2524.md

---------

Co-authored-by: Fabian-Lars <github@fabianlars.de>
pull/2526/head
Knobibrot 3 months ago committed by GitHub
parent 68eb74353b
commit 1bb1ced538
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,6 @@
---
"log": patch
"log-js": patch
---
enable TargetKind::LogDir on mobile

@ -159,11 +159,12 @@ pub enum TargetKind {
/// ///
/// ### Platform-specific /// ### Platform-specific
/// ///
/// |Platform | Value | Example | /// |Platform | Value | Example |
/// | ------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------- | /// | --------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
/// | Linux | `$XDG_DATA_HOME/{bundleIdentifier}/logs` or `$HOME/.local/share/{bundleIdentifier}/logs` | `/home/alice/.local/share/com.tauri.dev/logs` | /// | 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` | /// | 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` | /// | 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<String> }, LogDir { file_name: Option<String> },
/// Forward logs to the webview (via the `log://log` event). /// Forward logs to the webview (via the `log://log` event).
/// ///
@ -451,9 +452,6 @@ impl Builder {
)?)? )?)?
.into() .into()
} }
#[cfg(mobile)]
TargetKind::LogDir { .. } => continue,
#[cfg(desktop)]
TargetKind::LogDir { file_name } => { TargetKind::LogDir { file_name } => {
let path = app_handle.path().app_log_dir()?; let path = app_handle.path().app_log_dir()?;
if !path.exists() { if !path.exists() {

Loading…
Cancel
Save