From b60ee0f372bd2f9c9596f3b1059f9feddb2c9ae6 Mon Sep 17 00:00:00 2001 From: Christopher Berner Date: Mon, 22 Jul 2024 20:38:00 -0700 Subject: [PATCH] Downgrade many log messages from info! to debug! --- src/db.rs | 4 ++-- src/transaction_tracker.rs | 4 ++-- src/transactions.rs | 24 ++++++++++++------------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/db.rs b/src/db.rs index d418b751..76e5b4e5 100644 --- a/src/db.rs +++ b/src/db.rs @@ -25,7 +25,7 @@ use crate::sealed::Sealed; use crate::transactions::SAVEPOINT_TABLE; use crate::tree_store::file_backend::FileBackend; #[cfg(feature = "logging")] -use log::{info, warn}; +use log::{debug, info, warn}; #[allow(clippy::len_without_is_empty)] /// Implements persistent storage for a database. @@ -813,7 +813,7 @@ impl Database { pub fn begin_read(&self) -> Result { let guard = self.allocate_read_transaction()?; #[cfg(feature = "logging")] - info!("Beginning read transaction id={:?}", guard.id()); + debug!("Beginning read transaction id={:?}", guard.id()); ReadTransaction::new(self.get_memory(), guard) } } diff --git a/src/transaction_tracker.rs b/src/transaction_tracker.rs index 7dc2dd9c..3b4d3b10 100644 --- a/src/transaction_tracker.rs +++ b/src/transaction_tracker.rs @@ -1,7 +1,7 @@ use crate::tree_store::TransactionalMemory; use crate::{Key, Result, Savepoint, TypeName, Value}; #[cfg(feature = "logging")] -use log::info; +use log::debug; use std::cmp::Ordering; use std::collections::btree_map::BTreeMap; use std::collections::btree_set::BTreeSet; @@ -123,7 +123,7 @@ impl TransactionTracker { assert!(state.live_write_transaction.is_none()); let transaction_id = state.next_transaction_id.increment(); #[cfg(feature = "logging")] - info!("Beginning write transaction id={:?}", transaction_id); + debug!("Beginning write transaction id={:?}", transaction_id); state.live_write_transaction = Some(transaction_id); transaction_id diff --git a/src/transactions.rs b/src/transactions.rs index 39c6d724..9c7de4d7 100644 --- a/src/transactions.rs +++ b/src/transactions.rs @@ -17,7 +17,7 @@ use crate::{ UntypedTableHandle, }; #[cfg(feature = "logging")] -use log::{info, warn}; +use log::{debug, warn}; use std::borrow::Borrow; use std::cmp::min; use std::collections::{HashMap, HashSet}; @@ -283,7 +283,7 @@ impl<'db> SystemNamespace<'db> { definition: SystemTableDefinition, ) -> Result> { #[cfg(feature = "logging")] - info!("Opening system table: {}", definition); + debug!("Opening system table: {}", definition); let root = self .table_tree .get_or_create_table::(definition.name(), TableType::Normal) @@ -345,7 +345,7 @@ impl<'db> TableNamespace<'db> { definition: MultimapTableDefinition, ) -> Result, TableError> { #[cfg(feature = "logging")] - info!("Opening multimap table: {}", definition); + debug!("Opening multimap table: {}", definition); let (root, length) = self.inner_open::(definition.name(), TableType::Multimap)?; transaction.dirty.store(true, Ordering::Release); @@ -366,7 +366,7 @@ impl<'db> TableNamespace<'db> { definition: TableDefinition, ) -> Result, TableError> { #[cfg(feature = "logging")] - info!("Opening table: {}", definition); + debug!("Opening table: {}", definition); let (root, _) = self.inner_open::(definition.name(), TableType::Normal)?; transaction.dirty.store(true, Ordering::Release); @@ -395,7 +395,7 @@ impl<'db> TableNamespace<'db> { name: &str, ) -> Result { #[cfg(feature = "logging")] - info!("Deleting table: {}", name); + debug!("Deleting table: {}", name); transaction.dirty.store(true, Ordering::Release); self.inner_delete(name, TableType::Normal) } @@ -407,7 +407,7 @@ impl<'db> TableNamespace<'db> { name: &str, ) -> Result { #[cfg(feature = "logging")] - info!("Deleting multimap table: {}", name); + debug!("Deleting multimap table: {}", name); transaction.dirty.store(true, Ordering::Release); self.inner_delete(name, TableType::Multimap) } @@ -642,7 +642,7 @@ impl WriteTransaction { let (id, transaction_id) = self.allocate_savepoint()?; #[cfg(feature = "logging")] - info!( + debug!( "Creating savepoint id={:?}, txn_id={:?}", id, transaction_id ); @@ -682,7 +682,7 @@ impl WriteTransaction { return Err(SavepointError::InvalidSavepoint); } #[cfg(feature = "logging")] - info!( + debug!( "Beginning savepoint restore (id={:?}) in transaction id={:?}", savepoint.get_id(), self.transaction_id @@ -884,7 +884,7 @@ impl WriteTransaction { fn commit_inner(&mut self) -> Result<(), CommitError> { #[cfg(feature = "logging")] - info!( + debug!( "Committing transaction id={:?} with durability={:?}", self.transaction_id, self.durability ); @@ -901,7 +901,7 @@ impl WriteTransaction { } #[cfg(feature = "logging")] - info!( + debug!( "Finished commit of transaction id={:?}", self.transaction_id ); @@ -920,7 +920,7 @@ impl WriteTransaction { fn abort_inner(&mut self) -> Result { #[cfg(feature = "logging")] - info!("Aborting transaction id={:?}", self.transaction_id); + debug!("Aborting transaction id={:?}", self.transaction_id); for savepoint in self.created_persistent_savepoints.lock().unwrap().iter() { match self.delete_persistent_savepoint(savepoint.0) { Ok(_) => {} @@ -941,7 +941,7 @@ impl WriteTransaction { .clear_table_root_updates(); self.mem.rollback_uncommitted_writes()?; #[cfg(feature = "logging")] - info!("Finished abort of transaction id={:?}", self.transaction_id); + debug!("Finished abort of transaction id={:?}", self.transaction_id); Ok(()) }