Skip to content

Commit

Permalink
Clean up and align logging output
Browse files Browse the repository at this point in the history
  • Loading branch information
RickiNano committed Jul 9, 2024
1 parent 1cbf85f commit 1715e78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nano/secure/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p
if (!rocksdb_store->init_error ())
{
auto table_size = store.count (store.tx_begin_read (), tables::blocks);
logger.info (nano::log::type::ledger, "Step 1 of 7: Converting {} million entries from blocks table", table_size / 1000000);
logger.info (nano::log::type::ledger, "Step 1 of 7: Converting {} entries from blocks table", table_size);
std::atomic<std::size_t> count = 0;
store.block.for_each_par (
[&] (store::read_transaction const & /*unused*/, auto i, auto n) {
Expand All @@ -1288,7 +1288,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p

if (auto count_l = ++count; count_l % 5000000 == 0)
{
logger.info (nano::log::type::ledger, "{} million blocks converted", count_l / 1000000);
logger.info (nano::log::type::ledger, "{} blocks converted", count_l);
}
}
});
Expand Down Expand Up @@ -1392,7 +1392,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p
auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::final_votes }));
for (; i != n; ++i)
{
rocksdb_transaction.refresh_if_needed (refresh_interval);
rocksdb_transaction.refresh_if_needed ();
rocksdb_store->final_vote.put (rocksdb_transaction, i->first, i->second);
if (auto count_l = ++count; count_l % 500000 == 0)
{
Expand All @@ -1402,7 +1402,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p
});
logger.info (nano::log::type::ledger, "Finished converting {} entries", count.load ());

logger.info (nano::log::type::ledger, "Finalizing migration...");
logger.info (nano::log::type::ledger, "Finalizing and verifying migration...");
auto lmdb_transaction (store.tx_begin_read ());
auto version = store.version.get (lmdb_transaction);
auto rocksdb_transaction (rocksdb_store->tx_begin_write ());
Expand Down

0 comments on commit 1715e78

Please sign in to comment.