YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat: add macOS os_log support for Console.app integration
Andrew Breckenridge23213069dd7a
diff --git a/Cargo.lock b/Cargo.lockindex 0bd083f57..c03f3d489 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -5727,6 +5727,7 @@ dependencies = ["tower-http","tracing","tracing-appender",+ "tracing-oslog","tracing-subscriber","uuid","windows 0.58.0",@@ -7267,6 +7268,18 @@ dependencies = ["tracing-core",]+[[package]]+name = "tracing-oslog"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d76902d2a8d5f9f55a81155c08971734071968c90f2d9bfe645fe700579b2950"+dependencies = [+ "cc",+ "cfg-if",+ "tracing-core",+ "tracing-subscriber",+]+[[package]]name = "tracing-subscriber"version = "0.3.22"diff --git a/Cargo.toml b/Cargo.tomlindex 2ce7f79e1..8c21b99d8 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -33,6 +33,7 @@ cc = "1.0"oasgen = { version = "0.22.0", features = ["axum", "chrono"] }once_cell = "1.20.2"sentry = { version = "0.36.0", features = ["tracing"] }+tracing-oslog = "0.3.0"http-cache-reqwest = "0.15.0"reqwest = { version = "=0.12.12", features = ["blocking", "multipart", "json"] }diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lockindex 4bf026016..99b2da9d7 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -362,7 +362,7 @@ version = "1.1.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"dependencies = [- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -373,7 +373,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"dependencies = ["anstyle","once_cell_polyfill",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -2485,7 +2485,7 @@ dependencies = ["libc","option-ext","redox_users 0.5.2",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -2789,7 +2789,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"dependencies = ["libc",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -4542,7 +4542,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46"dependencies = ["hermit-abi","libc",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -5725,7 +5725,7 @@ version = "0.50.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"dependencies = [- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -6584,7 +6584,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"dependencies = ["libc",- "windows-sys 0.45.0",+ "windows-sys 0.61.2",][[package]]@@ -7955,7 +7955,7 @@ dependencies = ["errno","libc","linux-raw-sys 0.12.1",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -8022,7 +8022,7 @@ dependencies = ["security-framework","security-framework-sys","webpki-root-certs",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -8299,6 +8299,7 @@ dependencies = ["tower-http 0.4.4","tracing","tracing-appender",+ "tracing-oslog","tracing-subscriber","uuid","windows 0.58.0",@@ -8522,6 +8523,7 @@ dependencies = ["tower-http 0.5.2","tracing","tracing-appender",+ "tracing-oslog","tracing-subscriber","uuid","windows 0.58.0",@@ -10746,7 +10748,7 @@ dependencies = ["getrandom 0.4.1","once_cell","rustix 1.1.4",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -11291,6 +11293,18 @@ dependencies = ["tracing-core",]+[[package]]+name = "tracing-oslog"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d76902d2a8d5f9f55a81155c08971734071968c90f2d9bfe645fe700579b2950"+dependencies = [+ "cc",+ "cfg-if 1.0.4",+ "tracing-core",+ "tracing-subscriber",+]+[[package]]name = "tracing-subscriber"version = "0.3.22"@@ -12327,7 +12341,7 @@ version = "0.1.11"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"dependencies = [- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.tomlindex 102c1d3e9..e8e3588c3 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml@@ -127,6 +127,7 @@ tauri-plugin-single-instance = { version = "2.3.7", features = ["deep-link"] }tauri-plugin-updater = "2.10.0"[target.'cfg(target_os = "macos")'.dependencies]+tracing-oslog = "0.3.0"core-foundation = "0.10"cocoa = "0.26.0"objc = "0.2.7"diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rsindex 53631f2df..4018a71fd 100755--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs@@ -25,6 +25,9 @@ use tracing::{debug, error, info, warn};use tracing_appender::rolling::{RollingFileAppender, Rotation};use tracing_subscriber::prelude::*;use tracing_subscriber::EnvFilter;++#[cfg(target_os = "macos")]+use tracing_oslog::OsLogger;use updates::start_update_check;use window_api::ShowRewindWindow;@@ -1617,17 +1620,19 @@ async fn main() {// Initialize the tracing subscriber with both layers + optional Sentry layer// The Sentry layer captures error!() and warn!() events (not just panics)+ let registry = tracing_subscriber::registry()+ .with(file_layer)+ .with(console_layer);++ #[cfg(target_os = "macos")]+ let registry = registry.with(OsLogger::new("pe.screenpi", "app"));+if sentry_guard.is_some() {- tracing_subscriber::registry()- .with(file_layer)- .with(console_layer)+ registry.with(sentry::integrations::tracing::layer()).init();} else {- tracing_subscriber::registry()- .with(file_layer)- .with(console_layer)- .init();+ registry.init();}// Windows-specific setupdiff --git a/crates/screenpipe-server/Cargo.toml b/crates/screenpipe-server/Cargo.tomlindex 522ca91c4..81b5e05cd 100644--- a/crates/screenpipe-server/Cargo.toml+++ b/crates/screenpipe-server/Cargo.toml@@ -145,3 +145,4 @@ windows = { version = "0.58", features = [[target.'cfg(target_os = "macos")'.dependencies]cidre = { git = "https://github.com/yury/cidre.git", features = ["ns"] }+tracing-oslog = { workspace = true }diff --git a/crates/screenpipe-server/src/bin/screenpipe-server.rs b/crates/screenpipe-server/src/bin/screenpipe-server.rsindex 0b226215f..811f427a0 100644--- a/crates/screenpipe-server/src/bin/screenpipe-server.rs+++ b/crates/screenpipe-server/src/bin/screenpipe-server.rs@@ -57,6 +57,9 @@ use tracing_subscriber::util::SubscriberInitExt;use tracing_subscriber::{fmt, EnvFilter};use tracing_subscriber::{prelude::__tracing_subscriber_SubscriberExt, Layer};+#[cfg(target_os = "macos")]+use tracing_oslog::OsLogger;+/// Set the file descriptor limit for the process./// This helps prevent "Too many open files" errors during heavy WebSocket/video usage.#[cfg(unix)]@@ -220,6 +223,9 @@ fn setup_logging(local_data_dir: &PathBuf, cli: &Cli) -> anyhow::Result<WorkerGu.with_filter(make_env_filter()),);+ #[cfg(target_os = "macos")]+ let tracing_registry = tracing_registry.with(OsLogger::new("pe.screenpi", "server"));+#[cfg(feature = "debug-console")]let tracing_registry = tracing_registry.with(console_subscriber::spawn().with_filter(