Skip to content

Commit 37057d5

Browse files
KaiCreatesclaude
andcommitted
fix: v1.1.2 — startup panic from double logger init (closes #2)
egui_logger and tracing-subscriber both tried to install the global log backend. Only one can exist — the second .init() call panicked with "Unable to install global subscriber: SetLoggerError(())". Fix: - Remove tracing_subscriber::fmt().init() from main() - Enable "log" feature on tracing crate so tracing::info!/warn!/etc. bridge automatically to the log crate that egui_logger owns - Remove tracing-subscriber dependency (was only used for the init call) All tracing macros now reach the in-app Logs tab via egui_logger. No behavior change — log output is identical, panic is gone. Fixes: #2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a58c3c6 commit 37057d5

4 files changed

Lines changed: 26 additions & 87 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
---
99

10+
## [1.1.2] — 2026-03-08
11+
12+
### Fixed
13+
14+
**Startup panic: `Unable to install global subscriber: SetLoggerError(())`**
15+
- The app crashed immediately on launch with a panic from `tracing-subscriber`.
16+
- Root cause: `egui_logger::builder().init()` and `tracing_subscriber::fmt().init()`
17+
both attempt to install the global log backend. Only one can win — the second
18+
call panics unconditionally (no `.ok()` guard).
19+
- Fix: removed `tracing_subscriber::fmt().init()` entirely. Enabled the `log`
20+
feature on the `tracing` crate so all `tracing::info!()` / `warn!()` etc. calls
21+
automatically bridge to the `log` crate, which `egui_logger` captures for
22+
display in the Logs tab. No separate subscriber is needed.
23+
- Removed `tracing-subscriber` dependency (was only used for the conflicting init).
24+
25+
---
26+
1027
## [1.1.1] — 2026-03-08
1128

1229
### Fixed

src-tauri/Cargo.lock

Lines changed: 1 addition & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "inputsync"
3-
version = "1.1.1"
3+
version = "1.1.2"
44
description = "InputSync - Software KVM Switch"
55
authors = ["KaiCreates"]
66
edition = "2021"
@@ -19,9 +19,9 @@ egui_extras = "0.31"
1919
# System tray
2020
tray-icon = "0.19"
2121

22-
# Logging
23-
tracing = "0.1"
24-
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
22+
# Logging — tracing macros forward to the log crate via the "log" feature,
23+
# which egui_logger captures for in-app display. No separate subscriber needed.
24+
tracing = { version = "0.1", features = ["log"] }
2525
egui_logger = "0.6"
2626

2727
# TLS (optional SSL feature)

src-tauri/src/main.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -285,17 +285,12 @@ async fn async_main(
285285
}
286286

287287
fn main() {
288-
// Init egui_logger — captures log/tracing records into ring buffer for UI display
288+
// egui_logger is the sole global logger — it captures all log/tracing records
289+
// into a ring buffer displayed in the Logs tab.
290+
// tracing macros (info!, warn!, etc.) route through the log crate bridge
291+
// enabled by the "log" feature on the tracing crate — no separate subscriber needed.
289292
egui_logger::builder().init().ok();
290293

291-
// Also init tracing → forwards to log crate (which egui_logger reads)
292-
tracing_subscriber::fmt()
293-
.with_env_filter(
294-
tracing_subscriber::EnvFilter::try_from_default_env()
295-
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
296-
)
297-
.init();
298-
299294
let data_dir = data_dir();
300295
std::fs::create_dir_all(&data_dir).ok();
301296

0 commit comments

Comments
 (0)