Skip to content

Commit

Permalink
core: Log db open progress at INFO (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
kim authored Dec 8, 2023
1 parent 8ffa608 commit cb70cb3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/core/src/db/relational_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl RelationalDB {
) -> Result<Self, DBError> {
let db_address = address;
let address = address.to_hex();
log::debug!("[{}] DATABASE: OPENING", address);
log::info!("[{}] DATABASE: OPENING", address);

// Ensure that the `root` directory the database is running in exists.
create_dir_all(&root)?;
Expand All @@ -79,7 +79,7 @@ impl RelationalDB {
let mut transaction_offset = 0;
let commit_log = message_log
.map(|mlog| {
log::debug!("[{}] Replaying transaction log.", address);
log::info!("[{}] Replaying transaction log.", address);
let mut last_logged_percentage = 0;

let commit_log = CommitLog::new(mlog, odb);
Expand All @@ -95,7 +95,7 @@ impl RelationalDB {
f64::floor((commit.commit_offset as f64 / max_commit_offset as f64) * 100.0) as i32;
if percentage > last_logged_percentage && percentage % 10 == 0 {
last_logged_percentage = percentage;
log::debug!(
log::info!(
"[{}] Loaded {}% ({}/{})",
address,
percentage,
Expand Down Expand Up @@ -124,7 +124,7 @@ impl RelationalDB {
// There may eventually be better way to do this, but this will have to do for now.
datastore.rebuild_state_after_replay()?;

log::debug!(
log::info!(
"[{}] Initialized with {} commits and tx offset {}",
address,
commit_log.as_ref().map(|log| log.commit_offset()).unwrap_or_default(),
Expand All @@ -140,7 +140,7 @@ impl RelationalDB {
address: db_address,
};

log::trace!("[{}] DATABASE: OPENED", address);
log::info!("[{}] DATABASE: OPENED", address);
Ok(db)
}

Expand Down

0 comments on commit cb70cb3

Please sign in to comment.