Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade many log messages from info! to debug! #828

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -813,7 +813,7 @@ impl Database {
pub fn begin_read(&self) -> Result<ReadTransaction, TransactionError> {
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)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/transaction_tracker.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -283,7 +283,7 @@ impl<'db> SystemNamespace<'db> {
definition: SystemTableDefinition<K, V>,
) -> Result<SystemTable<'db, 's, K, V>> {
#[cfg(feature = "logging")]
info!("Opening system table: {}", definition);
debug!("Opening system table: {}", definition);
let root = self
.table_tree
.get_or_create_table::<K, V>(definition.name(), TableType::Normal)
Expand Down Expand Up @@ -345,7 +345,7 @@ impl<'db> TableNamespace<'db> {
definition: MultimapTableDefinition<K, V>,
) -> Result<MultimapTable<'txn, K, V>, TableError> {
#[cfg(feature = "logging")]
info!("Opening multimap table: {}", definition);
debug!("Opening multimap table: {}", definition);
let (root, length) = self.inner_open::<K, V>(definition.name(), TableType::Multimap)?;
transaction.dirty.store(true, Ordering::Release);

Expand All @@ -366,7 +366,7 @@ impl<'db> TableNamespace<'db> {
definition: TableDefinition<K, V>,
) -> Result<Table<'txn, K, V>, TableError> {
#[cfg(feature = "logging")]
info!("Opening table: {}", definition);
debug!("Opening table: {}", definition);
let (root, _) = self.inner_open::<K, V>(definition.name(), TableType::Normal)?;
transaction.dirty.store(true, Ordering::Release);

Expand Down Expand Up @@ -395,7 +395,7 @@ impl<'db> TableNamespace<'db> {
name: &str,
) -> Result<bool, TableError> {
#[cfg(feature = "logging")]
info!("Deleting table: {}", name);
debug!("Deleting table: {}", name);
transaction.dirty.store(true, Ordering::Release);
self.inner_delete(name, TableType::Normal)
}
Expand All @@ -407,7 +407,7 @@ impl<'db> TableNamespace<'db> {
name: &str,
) -> Result<bool, TableError> {
#[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)
}
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
);
Expand All @@ -901,7 +901,7 @@ impl WriteTransaction {
}

#[cfg(feature = "logging")]
info!(
debug!(
"Finished commit of transaction id={:?}",
self.transaction_id
);
Expand All @@ -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(_) => {}
Expand All @@ -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(())
}

Expand Down
Loading