Skip to content

Commit

Permalink
Clean up INFO: WARNING: ERROR: log entries
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Mar 28, 2021
1 parent 4ca0aa9 commit 78ec077
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/gridcoin/beacon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ bool BeaconRegistry::BeaconDB::insert(const uint256 &hash, const int& height, co
}
else
{
LogPrint(LogFlags::BEACON, "INFO %s - store beacon: cpid %s, address %s, height %i, timestamp %" PRId64
LogPrint(LogFlags::BEACON, "INFO: %s - store beacon: cpid %s, address %s, height %i, timestamp %" PRId64
", hash %s, prev_beacon_hash %s, status = %u.",
__func__,
beacon.m_cpid.ToString(), // cpid
Expand Down
4 changes: 2 additions & 2 deletions src/gridcoin/contract/contract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ void GRC::ReplayContracts(CBlockIndex* pindex_end, CBlockIndex* pindex_start)

if (beacons.NeedsIsContractCorrection())
{
LogPrintf("INFO %s: The NeedsIsContractCorrection flag is set. All blocks within the scan range "
LogPrintf("INFO: %s: The NeedsIsContractCorrection flag is set. All blocks within the scan range "
"will be checked to ensure the contains contract flag is set correctly and corrections made. "
"This may take a little longer than the standard replay.",
__func__);
Expand All @@ -469,7 +469,7 @@ void GRC::ReplayContracts(CBlockIndex* pindex_end, CBlockIndex* pindex_start)
// record.
if (found_contract && beacons.NeedsIsContractCorrection() && !pindex->IsContract())
{
LogPrintf("WARNING %s: There were found contract(s) in block %i but IsContract() is false. "
LogPrintf("WARNING: %s: There were found contract(s) in block %i but IsContract() is false. "
"Correcting IsContract flag to true in the block index.",
__func__,
pindex->nHeight);
Expand Down
8 changes: 4 additions & 4 deletions src/gridcoin/tally.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ class ResearcherTally
{
const SnapshotCalculator calc(superblock.m_timestamp, m_current_superblock);

LogPrint(BCLog::LogFlags::ACCRUAL, "INFO %s: superblock height = %u, m_researchers.size() = %u",
LogPrint(BCLog::LogFlags::ACCRUAL, "INFO: %s: superblock height = %u, m_researchers.size() = %u",
__func__, superblock.m_height, m_researchers.size());

for (auto& account_pair : m_researchers) {
Expand Down Expand Up @@ -627,7 +627,7 @@ class ResearcherTally

account.m_accrual = accrual_correction + accrual_delta;

LogPrint(BCLog::LogFlags::ACCRUAL, "INFO %s: accrual account not found "
LogPrint(BCLog::LogFlags::ACCRUAL, "INFO: %s: accrual account not found "
"for CPID %s. Creating account with accrual %" PRId64" from "
"Accrual Correction = %" PRId64 ", Accrual Delta = %" PRId64 ", "
"superblock height = %" PRId64 ", m_researchers.size() = %u.",
Expand Down Expand Up @@ -1037,7 +1037,7 @@ CAmount Tally::GetNewbieSuperblockAccrualCorrection(const Cpid& cpid, const Supe
GRC::BeaconRegistry& beacons = GRC::GetBeaconRegistry();
GRC::BeaconOption beacon = beacons.TryActive(cpid, current_superblock.m_timestamp);

LogPrint(BCLog::LogFlags::ACCRUAL, "INFO %s: beacon registry size = %u", __func__, beacons.Beacons().size());
LogPrint(BCLog::LogFlags::ACCRUAL, "INFO: %s: beacon registry size = %u", __func__, beacons.Beacons().size());

// Bail if there is no active beacon.
if (!beacon)
Expand Down Expand Up @@ -1088,7 +1088,7 @@ CAmount Tally::GetNewbieSuperblockAccrualCorrection(const Cpid& cpid, const Supe

CAmount period = tally_accrual_period(pindex->nTime, pindex_high->nTime, magnitude);

LogPrint(BCLog::LogFlags::ACCRUAL, "INFO %s: period_num = %u, "
LogPrint(BCLog::LogFlags::ACCRUAL, "INFO: %s: period_num = %u, "
"low height = %i, high height = %u, magnitude at low height SB = %f, "
"low time = %u, high time = %u, "
"accrual for period = %" PRId64 ", accrual = %" PRId64 ".",
Expand Down
2 changes: 1 addition & 1 deletion src/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ bool BCLog::Logger::EnableCategory(const std::string& str)
if (!GetLogCategory(flag, str)) {
if (str == "db") {
// DEPRECATION: Added in 0.20, should start returning an error in 0.21
LogPrintf("Warning: logging category 'db' is deprecated, use 'walletdb' instead\n");
LogPrintf("WARNING: logging category 'db' is deprecated, use 'walletdb' instead\n");
EnableCategory(BCLog::WALLETDB);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,7 @@ bool ForceReorganizeToHash(uint256 NewHash)
success = ReorganizeChain(txdb, cnt_dis, cnt_con, blockNew, pindexNew);

if(g_chain_trust.Best() < previous_chain_trust)
LogPrintf("WARNING ForceReorganizeToHash: Chain trust is now less than before!");
LogPrintf("WARNING: ForceReorganizeToHash: Chain trust is now less than before!");

if (!success)
{
Expand Down
6 changes: 3 additions & 3 deletions src/qt/addresstablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AddressTablePriv
case CT_NEW:
if(inModel)
{
LogPrintf("Warning: AddressTablePriv::updateEntry: Got CT_NEW, but entry is already in model");
LogPrintf("WARNING: AddressTablePriv::updateEntry: Got CT_NEW, but entry is already in model");
break;
}
parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex);
Expand All @@ -101,7 +101,7 @@ class AddressTablePriv
case CT_UPDATED:
if(!inModel)
{
LogPrintf("Warning: AddressTablePriv::updateEntry: Got CT_UPDATED, but entry is not in model");
LogPrintf("WARNING: AddressTablePriv::updateEntry: Got CT_UPDATED, but entry is not in model");
break;
}
lower->type = newEntryType;
Expand All @@ -111,7 +111,7 @@ class AddressTablePriv
case CT_DELETED:
if(!inModel)
{
LogPrintf("Warning: AddressTablePriv::updateEntry: Got CT_DELETED, but entry is not in model");
LogPrintf("WARNING: AddressTablePriv::updateEntry: Got CT_DELETED, but entry is not in model");
break;
}
parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);
Expand Down
10 changes: 5 additions & 5 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ UniValue auditsnapshotaccrual(const UniValue& params, bool fHelp)

GRC::BeaconRegistry& beacons = GRC::GetBeaconRegistry();

LogPrint(BCLog::LogFlags::ACCRUAL, "INFO %s: Number of beacons in registry = %u", __func__, beacons.Beacons().size());
LogPrint(BCLog::LogFlags::ACCRUAL, "INFO: %s: Number of beacons in registry = %u", __func__, beacons.Beacons().size());

GRC::BeaconOption beacon_try = beacons.Try(*cpid);

Expand All @@ -312,7 +312,7 @@ UniValue auditsnapshotaccrual(const UniValue& params, bool fHelp)

GRC::Beacon_ptr beacon_ptr = beacon_try;

LogPrint(BCLog::LogFlags::ACCRUAL, "INFO %s: active beacon: timestamp = %" PRId64 ", ctx_hash = %s,"
LogPrint(BCLog::LogFlags::ACCRUAL, "INFO: %s: active beacon: timestamp = %" PRId64 ", ctx_hash = %s,"
" prev_beacon_ctx_hash = %s",
__func__,
beacon_ptr->m_timestamp,
Expand All @@ -335,7 +335,7 @@ UniValue auditsnapshotaccrual(const UniValue& params, bool fHelp)

beacon_ptr = iter->second;

LogPrint(BCLog::LogFlags::ACCRUAL, "INFO %s: renewal %u beacon: timestamp = %" PRId64 ", ctx_hash = %s,"
LogPrint(BCLog::LogFlags::ACCRUAL, "INFO: %s: renewal %u beacon: timestamp = %" PRId64 ", ctx_hash = %s,"
" prev_beacon_ctx_hash = %s.",
__func__,
renewals,
Expand All @@ -354,7 +354,7 @@ UniValue auditsnapshotaccrual(const UniValue& params, bool fHelp)

const CBlockIndex* pindex_baseline = GRC::Tally::GetBaseline();

LogPrint(BCLog::LogFlags::ACCRUAL, "INFO %s: pindex_baseline->nHeight = %i", __func__, pindex_baseline->nHeight);
LogPrint(BCLog::LogFlags::ACCRUAL, "INFO: %s: pindex_baseline->nHeight = %i", __func__, pindex_baseline->nHeight);

const CBlockIndex* pindex_superblock;

Expand All @@ -370,7 +370,7 @@ UniValue auditsnapshotaccrual(const UniValue& params, bool fHelp)
}
}

LogPrint(BCLog::LogFlags::ACCRUAL, "INFO %s: First in scope superblock nHeight = %i", __func__,
LogPrint(BCLog::LogFlags::ACCRUAL, "INFO: %s: First in scope superblock nHeight = %i", __func__,
pindex_superblock->nHeight);

// Set the pindex_low to the pindex_superblock. For right now, we are going to take the accrual at the first snapshot
Expand Down
2 changes: 0 additions & 2 deletions src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ static const CRPCCommand vRPCCommands[] =
{ "comparesnapshotaccrual", &comparesnapshotaccrual, cat_developer },
{ "currentcontractaverage", &currentcontractaverage, cat_developer },
{ "debug", &debug, cat_developer },
{ "debug10", &debug10, cat_developer },
{ "dumpcontracts", &dumpcontracts, cat_developer },
{ "exportstats1", &rpc_exportstats, cat_developer },
{ "getblockstats", &rpc_getblockstats, cat_developer },
Expand Down Expand Up @@ -448,7 +447,6 @@ static const CRPCCommand vRPCCommands[] =

static constexpr const char* DEPRECATED_RPCS[] {
"debug",
"debug10",
"execute" ,
"getaccount",
"getaccountaddress",
Expand Down
2 changes: 0 additions & 2 deletions src/rpc/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ extern UniValue addkey(const UniValue& params, bool fHelp);
extern UniValue comparesnapshotaccrual(const UniValue& params, bool fHelp);
extern UniValue currentcontractaverage(const UniValue& params, bool fHelp);
extern UniValue debug(const UniValue& params, bool fHelp);
extern UniValue debug10(const UniValue& params, bool fHelp);
extern UniValue debug2(const UniValue& params, bool fHelp);
extern UniValue dumpcontracts(const UniValue& params, bool fHelp);
extern UniValue rpc_getblockstats(const UniValue& params, bool fHelp);
extern UniValue getlistof(const UniValue& params, bool fHelp);
Expand Down
12 changes: 6 additions & 6 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ bool CWallet::SelectCoins(int64_t nTargetValue, unsigned int nSpendTime, set<pai
}

if (contract) {
LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO %s: Contract is included so SelectSmallestCoins will be used.", __func__);
LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO: %s: Contract is included so SelectSmallestCoins will be used.", __func__);

return (SelectSmallestCoins(nTargetValue, nSpendTime, 1, 10, vCoins, setCoinsRet, nValueRet) ||
SelectSmallestCoins(nTargetValue, nSpendTime, 1, 1, vCoins, setCoinsRet, nValueRet) ||
Expand Down Expand Up @@ -1885,7 +1885,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
setcoins_total += output.first->vout[output.second].nValue;
}

LogPrintf("INFO %s: Just after SelectCoins: "
LogPrintf("INFO: %s: Just after SelectCoins: "
"nTotalValue = %s, nValueIn = %s, nValueOut = %s, setCoins total = %s.",
__func__,
FormatMoney(nTotalValue),
Expand Down Expand Up @@ -1934,7 +1934,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
FormatMoney(nFeeRet));
}

LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO %s: Before CENT test: nValueIn = %s, nValueOut = %s, "
LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO: %s: Before CENT test: nValueIn = %s, nValueOut = %s, "
"nChange = %s, nFeeRet = %s.",
__func__,
FormatMoney(nValueIn),
Expand All @@ -1951,7 +1951,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
nChange -= nMoveToFee;
nFeeRet += nMoveToFee;

LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO %s: After CENT limit adjustment: nChange = %s, "
LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO: %s: After CENT limit adjustment: nChange = %s, "
"nFeeRet = %s",
__func__,
FormatMoney(nChange),
Expand Down Expand Up @@ -2040,7 +2040,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
int64_t nPayFee = nTransactionFee * (1 + (int64_t)nBytes / 1000);
int64_t nMinFee = wtxNew.GetMinFee(1000, GMF_SEND, nBytes);

LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO %s: nTransactionFee = %s, nBytes = %" PRId64 ", nPayFee = %s"
LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO: %s: nTransactionFee = %s, nBytes = %" PRId64 ", nPayFee = %s"
", nMinFee = %s, nFeeRet = %s.",
__func__,
FormatMoney(nTransactionFee),
Expand All @@ -2055,7 +2055,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
continue;
}

LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO %s: FINAL nValueIn = %s, nChange = %s, nTransactionFee = %s,"
LogPrint(BCLog::LogFlags::ESTIMATEFEE, "INFO: %s: FINAL nValueIn = %s, nChange = %s, nTransactionFee = %s,"
" nBytes = %" PRId64 ", nPayFee = %s, nMinFee = %s, nFeeRet = %s.",
__func__,
FormatMoney(nValueIn),
Expand Down

0 comments on commit 78ec077

Please sign in to comment.