Skip to content

Commit

Permalink
Reduce log spam
Browse files Browse the repository at this point in the history
New debug category "staking" added with some previous `LogPrintf`
messages recategorized to reduce log spam.

Also noted both "staking" and "precompute" in the init help message and
added them to the "pivx" umbrella category.
  • Loading branch information
Fuzzbawls committed Mar 26, 2019
1 parent f79d6f1 commit 3850fd8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-stopafterblockimport", strprintf(_("Stop running after importing blocks from disk (default: %u)"), 0));
strUsage += HelpMessageOpt("-sporkkey=<privkey>", _("Enable spork administration functionality with the appropriate private key."));
}
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, tor, mempool, net, proxy, http, libevent, pivx, (obfuscation, swiftx, masternode, mnpayments, mnbudget, zero)"; // Don't translate these and qt below
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, tor, mempool, net, proxy, http, libevent, pivx, (obfuscation, swiftx, masternode, mnpayments, mnbudget, zero, precompute, staking)"; // Don't translate these and qt below
if (mode == HMM_BITCOIN_QT)
debugCategories += ", qt";
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
Expand Down
2 changes: 1 addition & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet,
}

if (!fStakeFound) {
LogPrintf("CreateNewBlock(): stake not found\n");
LogPrint("staking", "CreateNewBlock(): stake not found\n");
return NULL;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ bool LogAcceptCategory(const char* category)
ptrCategory->insert(string("mnpayments"));
ptrCategory->insert(string("zero"));
ptrCategory->insert(string("mnbudget"));
ptrCategory->insert(string("precompute"));
ptrCategory->insert(string("staking"));
}
}
const set<string>& setCategories = *ptrCategory.get();
Expand Down
4 changes: 2 additions & 2 deletions src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3001,7 +3001,7 @@ bool CWallet::CreateCoinStake(
}

if (listInputs.empty()) {
LogPrintf("CreateCoinStake(): listInputs empty\n");
LogPrint("staking", "CreateCoinStake(): listInputs empty\n");
MilliSleep(50000);
return false;
}
Expand Down Expand Up @@ -3106,7 +3106,7 @@ bool CWallet::CreateCoinStake(
if (fKernelFound)
break; // if kernel is found stop searching
}
LogPrintf("%s: attempted staking %d times\n", __func__, nAttempts);
LogPrint("staking", "%s: attempted staking %d times\n", __func__, nAttempts);

if (!fKernelFound)
return false;
Expand Down

0 comments on commit 3850fd8

Please sign in to comment.