Skip to content

Commit

Permalink
fix: process logs not showing on iOS (#8977)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Feb 25, 2024
1 parent 9cc014f commit cbd9755
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .changes/fix-ios-dev-logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@tauri-apps/cli": patch:bug
"tauri-cli": patch:bug
---

Fixes process logs not showing on `ios dev`.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions core/tauri-runtime-wry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2723,6 +2723,15 @@ fn handle_user_message<T: UserEvent>(
}
}
Message::Webview(window_id, webview_id, webview_message) => {
#[cfg(any(
target_os = "macos",
windows,
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
if let WebviewMessage::Reparent(new_parent_window_id) = webview_message {
let webview_handle = windows.0.borrow_mut().get_mut(&window_id).and_then(|w| {
w.webviews
Expand Down
8 changes: 8 additions & 0 deletions core/tauri/mobile/ios-api/Sources/Tauri/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ public class Logger {
}

public static func debug(_ items: Any..., category: String = "app") {
#if DEBUG
Logger.log(items, category: category, type: OSLogType.default)
#else
Logger.log(items, category: category, type: OSLogType.debug)
#endif
}

public static func info(_ items: Any..., category: String = "app") {
#if DEBUG
Logger.log(items, category: category, type: OSLogType.default)
#else
Logger.log(items, category: category, type: OSLogType.info)
#endif
}

public static func error(_ items: Any..., category: String = "app") {
Expand Down
2 changes: 1 addition & 1 deletion core/tauri/scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
true)

const action = () => {
window.window.__TAURI_INTERNALS__.ipc({
window.__TAURI_INTERNALS__.ipc({
cmd,
callback,
error,
Expand Down
16 changes: 8 additions & 8 deletions examples/api/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tooling/cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tooling/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ name = "cargo-tauri"
path = "src/main.rs"

[dependencies]
cargo-mobile2 = { version = "0.10.2", default-features = false }
cargo-mobile2 = { version = "0.10.3", default-features = false }
jsonrpsee = { version = "0.20", features = [ "server" ] }
jsonrpsee-core = "0.20"
jsonrpsee-client-transport = { version = "0.20", features = [ "ws" ] }
Expand Down

0 comments on commit cbd9755

Please sign in to comment.