diff --git a/src/database/hierarchies.rs b/src/database/hierarchies.rs index 2f44105..1458719 100644 --- a/src/database/hierarchies.rs +++ b/src/database/hierarchies.rs @@ -219,8 +219,8 @@ pub fn fetch_or_create_dir>( } } 1 => Ok(valid_directories[0].clone()), - _ => Err(anyhow!( - "Invalid database state - more than one directory matches the query!" + _ => Err(anyhow!(format!( + "Invalid database state - more than one directory matches the query {:?}/{:#}!", parent, directory) )), } } diff --git a/src/filesystem.rs b/src/filesystem.rs index 391fdb9..0dc2479 100644 --- a/src/filesystem.rs +++ b/src/filesystem.rs @@ -93,18 +93,18 @@ fn _rescan_vault>( job_id: JobId, ) -> Result> { let start = Instant::now(); - info!("[rescan] Vault rescan started."); + info!("Vault rescan started."); // Initialize types, etc... - debug!("[rescan] Initializing DB types."); + debug!("Initializing DB types."); initialize_types(&pool)?; // Disable syncing in SQLite for the duration of the import - debug!("[rescan] Disabling SQLite synchronous mode"); + debug!("Disabling SQLite synchronous mode"); pool.get()?.execute("PRAGMA synchronous = OFF;")?; // Walk through the vault, find all paths - debug!("[rescan] Traversing vault directory"); + debug!("Traversing vault directory"); let path_entries: Vec = WalkDir::new(&directory) .follow_links(true) .into_iter() @@ -187,7 +187,7 @@ fn _rescan_vault>( } // Re-enable SQLite syncing - debug!("[rescan] Re-enabling synchronous mode."); + debug!("Re-enabling synchronous mode."); pool.get()?.execute("PRAGMA synchronous = NORMAL;")?; info!( @@ -209,7 +209,7 @@ fn _process_directory_entry>( directory_path: &P, existing_files: &Arc>>, ) -> UpdatePathResult { - debug!("[rescan] Processing: {:?}", path); + debug!("Processing: {:?}", path); // Prepare the data let connection = &db_pool.write().unwrap().get()?; @@ -264,7 +264,7 @@ fn _process_directory_entry>( if let Some(idx) = maybe_existing_file { existing_files_write.swap_remove(idx); - debug!("[rescan] Unchanged: {:?}", path); + debug!("Unchanged: {:?}", path); return Ok(UpdatePathOutcome::Unchanged(path)); } } @@ -343,7 +343,7 @@ fn _process_directory_entry>( }; insert_entry(connection, name_entry)?; - info!("[rescan] Added: {:?}", path); + info!("Added: {:?}", path); Ok(UpdatePathOutcome::Added(path.clone())) }) }