Skip to content

Commit dbbcc55

Browse files
committed
Chore: Demote a lot of INFO log levels to DEBUG
- A lot less noise now!
1 parent 7572d13 commit dbbcc55

20 files changed

Lines changed: 85 additions & 85 deletions

File tree

apps/desktop/src-tauri/src/file_system/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,19 @@ pub fn init_volume_manager() {
8383
#[cfg(target_os = "macos")]
8484
{
8585
let attached = crate::volumes::get_attached_volumes();
86-
log::info!("Registering {} attached volume(s)", attached.len());
86+
log::debug!("Registering {} attached volume(s)", attached.len());
8787
for location in attached {
8888
let volume = Arc::new(LocalPosixVolume::new(&location.name, &location.path));
8989
VOLUME_MANAGER.register(&location.id, volume);
90-
log::info!(" Registered attached volume: {} -> {}", location.id, location.path);
90+
log::debug!(" Registered attached volume: {} -> {}", location.id, location.path);
9191
}
9292

9393
let cloud = crate::volumes::get_cloud_drives();
94-
log::info!("Registering {} cloud drive(s)", cloud.len());
94+
log::debug!("Registering {} cloud drive(s)", cloud.len());
9595
for location in cloud {
9696
let volume = Arc::new(LocalPosixVolume::new(&location.name, &location.path));
9797
VOLUME_MANAGER.register(&location.id, volume);
98-
log::info!(" Registered cloud drive: {} -> {}", location.id, location.path);
98+
log::debug!(" Registered cloud drive: {} -> {}", location.id, location.path);
9999
}
100100
}
101101

@@ -107,11 +107,11 @@ pub fn init_volume_manager() {
107107
.iter()
108108
.filter(|l| l.category != crate::volumes_linux::LocationCategory::Favorite)
109109
.collect();
110-
log::info!("Registering {} volume(s)", non_fav.len());
110+
log::debug!("Registering {} volume(s)", non_fav.len());
111111
for location in non_fav {
112112
let volume = Arc::new(LocalPosixVolume::new(&location.name, &location.path));
113113
VOLUME_MANAGER.register(&location.id, volume);
114-
log::info!(" Registered volume: {} -> {}", location.id, location.path);
114+
log::debug!(" Registered volume: {} -> {}", location.id, location.path);
115115
}
116116
}
117117
}

apps/desktop/src-tauri/src/indexing/aggregator.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn compute_subtree_aggregates(conn: &Connection, root: &str) -> Result<u64,
4646

4747
let start = std::time::Instant::now();
4848
let dir_count = dirs.len();
49-
log::info!("Subtree aggregation: starting bottom-up computation for {dir_count} directories under {root}");
49+
log::debug!("Subtree aggregation: starting bottom-up computation for {dir_count} directories under {root}");
5050

5151
// Phase 1: Load direct children stats scoped to this subtree only
5252
let direct_stats = scoped_get_children_stats(conn, root)?;
@@ -110,7 +110,7 @@ pub fn compute_subtree_aggregates(conn: &Connection, root: &str) -> Result<u64,
110110
IndexStore::upsert_dir_stats(conn, chunk)?;
111111
}
112112

113-
log::info!(
113+
log::debug!(
114114
"Subtree aggregation: complete. {count} directories processed in {:.1}ms",
115115
start.elapsed().as_secs_f64() * 1000.0,
116116
);
@@ -220,21 +220,21 @@ fn compute_root_stats(conn: &Connection) -> Result<(), IndexStoreError> {
220220
fn compute_aggregates_for_dirs(conn: &Connection, dirs: &[String]) -> Result<u64, IndexStoreError> {
221221
let start = std::time::Instant::now();
222222
let dir_count = dirs.len();
223-
log::info!("Aggregation: starting bottom-up computation for {dir_count} directories");
223+
log::debug!("Aggregation: starting bottom-up computation for {dir_count} directories");
224224

225225
// Phase 1: Bulk-load direct children stats for ALL parent paths in two SQL queries.
226226
// This replaces N individual get_children_stats + get_child_directory_paths calls.
227-
log::info!("Aggregation: loading direct children stats (bulk query)...");
227+
log::debug!("Aggregation: loading direct children stats (bulk query)...");
228228
let direct_stats = bulk_get_children_stats(conn)?;
229-
log::info!(
229+
log::debug!(
230230
"Aggregation: loaded stats for {} parent paths in {:.1}s",
231231
direct_stats.len(),
232232
start.elapsed().as_secs_f64()
233233
);
234234

235-
log::info!("Aggregation: loading child directory relationships (bulk query)...");
235+
log::debug!("Aggregation: loading child directory relationships (bulk query)...");
236236
let child_dirs_map = bulk_get_child_directory_paths(conn)?;
237-
log::info!(
237+
log::debug!(
238238
"Aggregation: loaded child dirs for {} parent paths in {:.1}s",
239239
child_dirs_map.len(),
240240
start.elapsed().as_secs_f64()
@@ -276,7 +276,7 @@ fn compute_aggregates_for_dirs(conn: &Connection, dirs: &[String]) -> Result<u64
276276
);
277277

278278
if (i + 1) % 100_000 == 0 {
279-
log::info!(
279+
log::debug!(
280280
"Aggregation: processed {}/{dir_count} directories ({:.1}s)",
281281
i + 1,
282282
start.elapsed().as_secs_f64()
@@ -285,15 +285,15 @@ fn compute_aggregates_for_dirs(conn: &Connection, dirs: &[String]) -> Result<u64
285285
}
286286

287287
// Phase 3: Batch-write all computed stats in chunks of 1000
288-
log::info!("Aggregation: writing {} dir_stats rows to DB...", computed.len());
288+
log::debug!("Aggregation: writing {} dir_stats rows to DB...", computed.len());
289289
let all_stats: Vec<DirStats> = computed.into_values().collect();
290290
let count = all_stats.len() as u64;
291291

292292
for chunk in all_stats.chunks(1000) {
293293
IndexStore::upsert_dir_stats(conn, chunk)?;
294294
}
295295

296-
log::info!(
296+
log::debug!(
297297
"Aggregation: complete. {count} directories processed in {:.1}s",
298298
start.elapsed().as_secs_f64()
299299
);

apps/desktop/src-tauri/src/indexing/mod.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl IndexManager {
238238
Err(e) => log::warn!("Failed to open global index read connection: {e}"),
239239
}
240240

241-
log::info!(
241+
log::debug!(
242242
"IndexManager created for volume '{volume_id}' at {}",
243243
volume_root.display()
244244
);
@@ -282,19 +282,19 @@ impl IndexManager {
282282
if let Some(ref last_event_id_str) = status.last_event_id {
283283
let last_event_id: u64 = last_event_id_str.parse().unwrap_or(0);
284284
if last_event_id > 0 {
285-
log::info!(
285+
log::debug!(
286286
"Existing index found (scan_completed_at={}, last_event_id={last_event_id}), \
287287
attempting sinceWhen replay",
288288
status.scan_completed_at.as_deref().unwrap_or("?"),
289289
);
290290
return self.start_replay(last_event_id);
291291
}
292292
}
293-
log::info!("Existing index found but no last_event_id, starting fresh scan");
293+
log::debug!("Existing index found but no last_event_id, starting fresh scan");
294294
} else if status.scan_completed_at.is_some() {
295-
log::info!("Existing index found, starting rescan (no event replay on this platform)");
295+
log::debug!("Existing index found, starting rescan (no event replay on this platform)");
296296
} else {
297-
log::info!("No existing index (scan_completed_at not set), starting fresh scan");
297+
log::debug!("No existing index (scan_completed_at not set), starting fresh scan");
298298
}
299299

300300
self.start_scan()
@@ -312,7 +312,7 @@ impl IndexManager {
312312
match DriveWatcher::start(&self.volume_root, since_event_id, event_tx) {
313313
Ok(watcher) => {
314314
self.drive_watcher = Some(watcher);
315-
log::info!("DriveWatcher started for replay (sinceWhen={since_event_id}, current={current_id})");
315+
log::debug!("DriveWatcher started for replay (sinceWhen={since_event_id}, current={current_id})");
316316
}
317317
Err(e) => {
318318
log::warn!("Failed to start DriveWatcher for replay: {e}, falling back to full scan");
@@ -419,7 +419,7 @@ impl IndexManager {
419419
match DriveWatcher::start(&self.volume_root, 0, event_tx) {
420420
Ok(watcher) => {
421421
self.drive_watcher = Some(watcher);
422-
log::info!("DriveWatcher started (scan_start_event_id={scan_start_event_id})");
422+
log::debug!("DriveWatcher started (scan_start_event_id={scan_start_event_id})");
423423
}
424424
Err(e) => {
425425
// Watcher failure is non-fatal: scan works without it, just no live updates
@@ -503,7 +503,7 @@ impl IndexManager {
503503

504504
match result {
505505
Ok(Ok(summary)) => {
506-
log::info!(
506+
log::debug!(
507507
"Volume scan complete: {} entries, {} dirs, {}ms",
508508
summary.total_entries,
509509
summary.total_dirs,
@@ -520,12 +520,12 @@ impl IndexManager {
520520
reconciler.buffer_event(event);
521521
buffered_count += 1;
522522
}
523-
log::info!("Reconciler: buffered {buffered_count} events during scan");
523+
log::debug!("Reconciler: buffered {buffered_count} events during scan");
524524

525525
// Replay events that arrived after the scan read their paths
526526
match reconciler.replay(scan_start_event_id, &writer, &app) {
527527
Ok(last_id) => {
528-
log::info!("Reconciler: replay complete (last_event_id={last_id})");
528+
log::debug!("Reconciler: replay complete (last_event_id={last_id})");
529529
}
530530
Err(e) => {
531531
log::warn!("Reconciler: replay failed: {e}");
@@ -688,7 +688,7 @@ impl IndexManager {
688688
self.stop_scan();
689689
self.writer.shutdown();
690690
clear_global_index_store();
691-
log::info!("IndexManager shut down for volume '{}'", self.volume_id);
691+
log::debug!("IndexManager shut down for volume '{}'", self.volume_id);
692692
}
693693
}
694694

@@ -706,7 +706,7 @@ async fn run_live_event_loop(
706706
writer: IndexWriter,
707707
app: AppHandle,
708708
) {
709-
log::info!("Live event processing started");
709+
log::debug!("Live event processing started");
710710
let mut event_count = 0u64;
711711
let mut pending_paths = std::collections::HashSet::<String>::new();
712712
let mut flush_interval = tokio::time::interval(Duration::from_millis(300));
@@ -720,7 +720,7 @@ async fn run_live_event_loop(
720720
reconciler.process_live_event(&event, &writer, &mut pending_paths);
721721
event_count += 1;
722722
if event_count.is_multiple_of(10_000) {
723-
log::info!("Live event processing: {event_count} events processed so far");
723+
log::debug!("Live event processing: {event_count} events processed so far");
724724
}
725725
}
726726
None => {
@@ -740,7 +740,7 @@ async fn run_live_event_loop(
740740
}
741741
}
742742

743-
log::info!("Live event processing stopped after {event_count} events");
743+
log::debug!("Live event processing stopped after {event_count} events");
744744
}
745745

746746
// ── Replay event loop (cold start sinceWhen) ─────────────────────────
@@ -788,7 +788,7 @@ async fn run_replay_event_loop(
788788
since_event_id,
789789
estimated_total,
790790
} = config;
791-
log::info!("Replay event processing started (since_event_id={since_event_id})");
791+
log::debug!("Replay event processing started (since_event_id={since_event_id})");
792792

793793
let mut event_count = 0u64;
794794
let mut first_event_checked = false;
@@ -832,7 +832,7 @@ async fn run_replay_event_loop(
832832
}
833833
return Ok(());
834834
}
835-
log::info!(
835+
log::debug!(
836836
"Replay: first event_id={}, gap from stored={}, journal appears available",
837837
event.event_id,
838838
event.event_id.saturating_sub(since_event_id),
@@ -841,7 +841,7 @@ async fn run_replay_event_loop(
841841

842842
// HistoryDone marks end of replay phase
843843
if event.flags.history_done {
844-
log::info!("Replay: HistoryDone received after {event_count} events");
844+
log::debug!("Replay: HistoryDone received after {event_count} events");
845845

846846
// Process the HistoryDone event itself (it may carry other flags)
847847
if let Some(paths) = reconciler::process_fs_event(&event, &writer) {
@@ -892,7 +892,7 @@ async fn run_replay_event_loop(
892892

893893
// Log milestone counts
894894
if event_count.is_multiple_of(10_000) {
895-
log::info!("Replay: {event_count} events processed so far");
895+
log::debug!("Replay: {event_count} events processed so far");
896896
}
897897
}
898898

@@ -915,7 +915,7 @@ async fn run_replay_event_loop(
915915
match writer.flush().await {
916916
Ok(()) => {
917917
let flush_ms = flush_start.elapsed().as_millis();
918-
log::info!(
918+
log::debug!(
919919
"Replay complete: {event_count} events, {} affected dirs, {flush_ms}ms writer flush, \
920920
{}ms total",
921921
affected_paths.len(),
@@ -944,7 +944,7 @@ async fn run_replay_event_loop(
944944

945945
// ── Switch to live mode immediately (before verification) ────────
946946

947-
log::info!("Replay: switching to live mode");
947+
log::debug!("Replay: switching to live mode");
948948
micro_scans.set_replay_active(false);
949949
log::debug!("Replay: micro-scans re-enabled for live mode");
950950
let mut reconciler = EventReconciler::new();
@@ -976,7 +976,7 @@ async fn run_replay_event_loop(
976976
reconciler.process_live_event(&event, &writer, &mut live_pending_paths);
977977
live_count += 1;
978978
if live_count.is_multiple_of(10_000) {
979-
log::info!("Live event processing (post-replay): {live_count} events");
979+
log::debug!("Live event processing (post-replay): {live_count} events");
980980
}
981981
}
982982
None => {
@@ -995,7 +995,7 @@ async fn run_replay_event_loop(
995995
}
996996
}
997997

998-
log::info!("Replay event loop stopped ({event_count} replay + {live_count} live events)");
998+
log::debug!("Replay event loop stopped ({event_count} replay + {live_count} live events)");
999999
Ok(())
10001000
}
10011001

@@ -1012,7 +1012,7 @@ async fn run_background_verification(
10121012
app: AppHandle,
10131013
) {
10141014
let verify_start = std::time::Instant::now();
1015-
log::info!(
1015+
log::debug!(
10161016
"Background verification started ({} affected dirs)",
10171017
affected_paths.len(),
10181018
);
@@ -1046,7 +1046,7 @@ async fn run_background_verification(
10461046
verify_result.stale_count > 0 || verify_result.new_file_count > 0 || !verify_result.new_dir_paths.is_empty();
10471047

10481048
if has_changes {
1049-
log::info!(
1049+
log::debug!(
10501050
"Background verification found {} stale, {} new files, {} new dirs; flushing",
10511051
verify_result.stale_count,
10521052
verify_result.new_file_count,
@@ -1106,7 +1106,7 @@ async fn run_background_verification(
11061106
reconciler::emit_dir_updated(&app, corrected_paths);
11071107
}
11081108

1109-
log::info!(
1109+
log::debug!(
11101110
"Background verification completed in {}ms",
11111111
verify_start.elapsed().as_millis(),
11121112
);
@@ -1262,7 +1262,7 @@ fn verify_affected_dirs(affected_paths: &std::collections::HashSet<String>, writ
12621262
}
12631263

12641264
if stale_count > 0 || new_file_count > 0 || !new_dir_paths.is_empty() {
1265-
log::info!(
1265+
log::debug!(
12661266
"Replay verification: {stale_count} stale, {new_file_count} new files, \
12671267
{} new dirs across {} affected dirs",
12681268
new_dir_paths.len(),
@@ -1334,7 +1334,7 @@ pub fn start_indexing(app: &AppHandle) -> Result<(), String> {
13341334
let mut guard = state.0.lock().map_err(|e| format!("Failed to lock state: {e}"))?;
13351335
*guard = Some(manager);
13361336

1337-
log::info!("Indexing system initialized for root volume");
1337+
log::debug!("Indexing system initialized for root volume");
13381338
Ok(())
13391339
}
13401340

apps/desktop/src-tauri/src/indexing/reconciler.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl EventReconciler {
111111
let mut last_event_id = scan_start_event_id;
112112
let mut affected_paths: Vec<String> = Vec::new();
113113

114-
log::info!("Reconciler: replaying {total} buffered events (scan_start_event_id={scan_start_event_id})");
114+
log::debug!("Reconciler: replaying {total} buffered events (scan_start_event_id={scan_start_event_id})");
115115

116116
for event in &self.buffer {
117117
// Skip events that the scan already covered
@@ -137,7 +137,7 @@ impl EventReconciler {
137137
let _ = writer.send(WriteMessage::UpdateLastEventId(last_event_id));
138138
}
139139

140-
log::info!("Reconciler: replayed {processed}/{total} events (last_event_id={last_event_id})");
140+
log::debug!("Reconciler: replayed {processed}/{total} events (last_event_id={last_event_id})");
141141
Ok(last_event_id)
142142
}
143143

@@ -146,7 +146,7 @@ impl EventReconciler {
146146
self.buffering = false;
147147
self.buffer.clear();
148148
self.buffer.shrink_to_fit();
149-
log::info!("Reconciler: switched to live mode");
149+
log::debug!("Reconciler: switched to live mode");
150150
}
151151

152152
/// Process a single event in live mode.
@@ -209,7 +209,7 @@ impl EventReconciler {
209209
let writer = writer.clone();
210210
let rescan_active = Arc::clone(&self.rescan_active);
211211

212-
log::info!("Reconciler: starting MustScanSubDirs rescan for {}", path.display());
212+
log::debug!("Reconciler: starting MustScanSubDirs rescan for {}", path.display());
213213

214214
tokio::task::spawn_blocking(move || {
215215
let start = Instant::now();

0 commit comments

Comments
 (0)