diff --git a/burrow/Cargo.toml b/burrow/Cargo.toml index 3bae2ae..15facd1 100644 --- a/burrow/Cargo.toml +++ b/burrow/Cargo.toml @@ -25,7 +25,6 @@ tun = { version = "0.1", path = "../tun", features = ["serde", "tokio"] } clap = { version = "4.4", features = ["derive"] } tracing = "0.1" tracing-log = "0.1" -tracing-oslog = { git = "https://github.com/Stormshield-robinc/tracing-oslog" } tracing-subscriber = { version = "0.3", features = ["std", "env-filter"] } log = "0.4" serde = { version = "1", features = ["derive"] } @@ -82,6 +81,9 @@ libc = "0.2" nix = { version = "0.27", features = ["ioctl"] } rusqlite = { version = "0.38.0", features = ["bundled", "blob"] } +[target.'cfg(target_os = "macos")'.dependencies] +tracing-oslog = { git = "https://github.com/Stormshield-robinc/tracing-oslog" } + [dev-dependencies] insta = { version = "1.32", features = ["yaml"] } diff --git a/burrow/src/tracing.rs b/burrow/src/tracing.rs index 861b41f..d48c53b 100644 --- a/burrow/src/tracing.rs +++ b/burrow/src/tracing.rs @@ -29,12 +29,15 @@ pub fn initialize() { } }; - #[cfg(target_vendor = "apple")] + #[cfg(target_os = "macos")] let system_log = Some(tracing_oslog::OsLogger::new( "com.hackclub.burrow", "tracing", )); + #[cfg(all(target_vendor = "apple", not(target_os = "macos")))] + let system_log = None::; + let stderr = (console::user_attended_stderr() || system_log.is_none()).then(|| { tracing_subscriber::fmt::layer() .with_level(true)