mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
re-work -debug switch handling
- re-work -debug help message text - make -debug log every debugging information again (even all categories) - remove unneeded fDebug checks in front of LogPrint()/qDebug(), as that check is done in LogPrintf() when category is != NULL (true for all LogPrint() calls - remove fDebug ONLY in code which is NOT performance-critical - harmonize addrman category name - deprecate -debugnet usage, should be used via -debug=net and remove the corresponding global
This commit is contained in:
31
src/init.cpp
31
src/init.cpp
@@ -215,8 +215,18 @@ std::string HelpMessage(HelpMessageMode hmm)
|
||||
#endif
|
||||
#endif
|
||||
strUsage += " -paytxfee=<amt> " + _("Fee per KB to add to transactions you send") + "\n";
|
||||
strUsage += " -debug " + _("Output extra debugging information. Implies all other -debug* options") + "\n";
|
||||
strUsage += " -debugnet " + _("Output extra network debugging information") + "\n";
|
||||
strUsage += " -debug=<category> " + _("Output debugging information (default: 0, supplying <category> is optional)") + "\n";
|
||||
strUsage += _("If <category> is not supplied, output all debugging information.") + "\n";
|
||||
strUsage += _("<category> can be:");
|
||||
strUsage += " addrman, alert, coindb, db, lock, rand, rpc, selectcoins, mempool, net"; // Don't translate these and qt below
|
||||
if (hmm == HMM_BITCOIN_QT)
|
||||
{
|
||||
strUsage += ", qt.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
strUsage += ".\n";
|
||||
}
|
||||
strUsage += " -logtimestamps " + _("Prepend debug output with timestamp") + "\n";
|
||||
strUsage += " -shrinkdebugfile " + _("Shrink debug.log file on client startup (default: 1 when no -debug)") + "\n";
|
||||
strUsage += " -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n";
|
||||
@@ -457,7 +467,16 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
|
||||
// ********************************************************* Step 3: parameter-to-internal-flags
|
||||
|
||||
if (mapMultiArgs.count("-debug")) fDebug = true;
|
||||
fDebug = !mapMultiArgs["-debug"].empty();
|
||||
// Special-case: if -debug=0/-nodebug is set, turn off debugging messages
|
||||
const vector<string>& categories = mapMultiArgs["-debug"];
|
||||
if (GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), string("0")) != categories.end())
|
||||
fDebug = false;
|
||||
|
||||
// Check for -debugnet (deprecated)
|
||||
if (GetBoolArg("-debugnet", false))
|
||||
InitWarning(_("Warning: Deprecated argument -debugnet ignored, use -debug=net"));
|
||||
|
||||
fBenchmark = GetBoolArg("-benchmark", false);
|
||||
mempool.fChecks = GetBoolArg("-checkmempool", RegTest());
|
||||
Checkpoints::fEnabled = GetBoolArg("-checkpoints", true);
|
||||
@@ -471,12 +490,6 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS)
|
||||
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS;
|
||||
|
||||
// -debug implies fDebug*
|
||||
if (fDebug)
|
||||
fDebugNet = true;
|
||||
else
|
||||
fDebugNet = GetBoolArg("-debugnet", false);
|
||||
|
||||
if (fDaemon)
|
||||
fServer = true;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user