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
chore: remove log dependency and fully switch to tracing
Louis Beaumonte772b97f99fd
diff --git a/screenpipe-server/Cargo.toml b/screenpipe-server/Cargo.tomlindex d0dbde159..3017ddfc3 100644--- a/screenpipe-server/Cargo.toml+++ b/screenpipe-server/Cargo.toml@@ -53,7 +53,6 @@ tokio = { version = "1.15", features = ["full", "tracing"] }tower-http = { version = "0.5.2", features = ["cors", "trace"] }# Log-log = { workspace = true }tracing = { workspace = true }tracing-subscriber = { workspace = true }tracing-appender = { workspace = true }diff --git a/screenpipe-server/src/cli.rs b/screenpipe-server/src/cli.rsindex 60d67bc44..e0467ce57 100644--- a/screenpipe-server/src/cli.rs+++ b/screenpipe-server/src/cli.rs@@ -64,7 +64,7 @@ impl From<CliOcrEngine> for CoreOcrEngine {match serde_json::from_str(&config_str) {Ok(config) => CoreOcrEngine::Custom(config),Err(e) => {- log::warn!("failed to parse custom ocr config from env: {}", e);+ tracing::warn!("failed to parse custom ocr config from env: {}", e);CoreOcrEngine::Custom(CustomOcrConfig::default())}}diff --git a/screenpipe-server/src/core.rs b/screenpipe-server/src/core.rsindex fb4a3822c..90ad2f584 100644--- a/screenpipe-server/src/core.rs+++ b/screenpipe-server/src/core.rs@@ -4,7 +4,6 @@ use crate::{DatabaseManager, VideoCapture};use anyhow::Result;use futures::future::join_all;use futures::StreamExt;-use log::{debug, error, info, warn};use screenpipe_audio::{record_and_transcribe, AudioInput, AudioTranscriptionEngine, TranscriptionResult,};@@ -20,6 +19,7 @@ use std::sync::Arc;use std::time::Duration;use tokio::runtime::Handle;use tokio::task::JoinHandle;+use tracing::{debug, error, info, warn};#[derive(Clone)]pub struct RecordingConfig {@@ -306,7 +306,7 @@ async fn record_video(_ => continue, // Ignore other devices or monitors}}- // we should process faster than the fps we use to do OCR+ // we should process faster than the fps we use to do OCR_ = tokio::time::sleep(Duration::from_secs_f64(1.0 / (config.fps * 2.0))) => {let frame = match video_capture.ocr_frame_queue.pop() {Some(f) => f,diff --git a/screenpipe-server/src/db.rs b/screenpipe-server/src/db.rsindex c94ad23f0..fdc16dfdb 100644--- a/screenpipe-server/src/db.rs+++ b/screenpipe-server/src/db.rs@@ -1,7 +1,7 @@use chrono::{DateTime, Utc};use image::DynamicImage;use libsqlite3_sys::sqlite3_auto_extension;-use log::{debug, error, warn};+use tracing::{debug, error, warn};use screenpipe_core::{AudioDevice, AudioDeviceType};use screenpipe_vision::OcrEngine;use sqlite_vec::sqlite3_vec_init;diff --git a/screenpipe-server/src/filtering.rs b/screenpipe-server/src/filtering.rsindex 803db5408..3566bbaf9 100644--- a/screenpipe-server/src/filtering.rs+++ b/screenpipe-server/src/filtering.rs@@ -3,7 +3,7 @@ use ndarray::{Array2, Axis};use rust_stemmers::{Algorithm, Stemmer};use std::collections::{HashMap, HashSet};use std::error::Error;-use log::debug;+use tracing::debug;fn keep_least_similar(chunks: &[String], percentage: f64) -> Vec<usize> {if chunks.is_empty() {@@ -100,4 +100,4 @@ pub async fn filter_texts(timestamp: &str, memory_source: &str, pool: &SqlitePoolet output = kept_texts.iter().map(|s| s.as_str()).collect::<Vec<&str>>().join("\n");Ok(output)-}\ No newline at end of file+}diff --git a/screenpipe-server/src/server.rs b/screenpipe-server/src/server.rsindex be756f124..de8b42f72 100644--- a/screenpipe-server/src/server.rs+++ b/screenpipe-server/src/server.rs@@ -34,7 +34,7 @@ use crate::{};use crate::{plugin::ApiPluginLayer, video_utils::extract_frame};use chrono::{DateTime, Utc};-use log::{debug, error, info};+use tracing::{debug, error, info};use screenpipe_audio::{default_input_device, default_output_device, list_audio_devices};use screenpipe_vision::monitor::list_monitors;diff --git a/screenpipe-server/src/video.rs b/screenpipe-server/src/video.rsindex 6c8b1299c..1c36d0b28 100644--- a/screenpipe-server/src/video.rs+++ b/screenpipe-server/src/video.rs@@ -1,7 +1,6 @@use chrono::Utc;use crossbeam::queue::ArrayQueue;-use log::{debug, error};-use log::{info, warn};+use tracing::{debug, error, info, warn};use screenpipe_core::{find_ffmpeg_path, Language};use screenpipe_vision::{capture_screenshot_by_window::WindowFilters, continuous_capture, CaptureResult, OcrEngine,