mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Few debug related fixes
- make logthreadnames work correctly without logtimestamps (and with emty strings again) - fix crash in debug (it3) - log debug info about locks in one line - show actual DS rounds instead of n/a in coin control while in debug mode - fix initial string in debug.log: "Bitcoin version" -> "Dash version"
This commit is contained in:
parent
dee72ad0cd
commit
981efed749
@ -875,7 +875,7 @@ void InitLogging()
|
||||
fLogIPs = GetBoolArg("-logips", DEFAULT_LOGIPS);
|
||||
|
||||
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||
LogPrintf("Bitcoin version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
|
||||
LogPrintf("Dash version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
|
||||
}
|
||||
|
||||
/** Initialize dash.
|
||||
@ -1702,7 +1702,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
pwalletMain->SetBestChain(chainActive.GetLocator());
|
||||
}
|
||||
|
||||
if(!strErrors.str().empty()) LogPrintf("%s", strErrors.str());
|
||||
LogPrintf("%s", strErrors.str());
|
||||
LogPrintf(" wallet %15dms\n", GetTimeMillis() - nStart);
|
||||
|
||||
RegisterValidationInterface(pwalletMain);
|
||||
|
@ -342,7 +342,7 @@ void CMasternodeMan::CheckAndRemove(bool forceExpiredRemoval)
|
||||
map<uint256, CMasternodePing>::iterator it4 = mapSeenMasternodePing.begin();
|
||||
while(it4 != mapSeenMasternodePing.end()){
|
||||
if((*it4).second.sigTime < GetTime() - MASTERNODE_REMOVAL_SECONDS*2){
|
||||
LogPrint("masternode", "CMasternodeMan::CheckAndRemove - Removing expired Masternode ping %s\n", (*it3).second.GetHash().ToString());
|
||||
LogPrint("masternode", "CMasternodeMan::CheckAndRemove - Removing expired Masternode ping %s\n", (*it4).second.GetHash().ToString());
|
||||
mapSeenMasternodePing.erase(it4++);
|
||||
} else {
|
||||
++it4;
|
||||
|
@ -845,7 +845,7 @@ void CoinControlDialog::updateView()
|
||||
CTxIn vin = CTxIn(out.tx->GetHash(), out.i);
|
||||
int rounds = pwalletMain->GetInputDarksendRounds(vin);
|
||||
|
||||
if(rounds >= 0) itemOutput->setText(COLUMN_DARKSEND_ROUNDS, strPad(QString::number(rounds), 11, " "));
|
||||
if(rounds >= 0 || fDebug) itemOutput->setText(COLUMN_DARKSEND_ROUNDS, strPad(QString::number(rounds), 11, " "));
|
||||
else itemOutput->setText(COLUMN_DARKSEND_ROUNDS, strPad(QString(tr("n/a")), 11, " "));
|
||||
|
||||
|
||||
|
@ -15,8 +15,7 @@
|
||||
#ifdef DEBUG_LOCKCONTENTION
|
||||
void PrintLockContention(const char* pszName, const char* pszFile, int nLine)
|
||||
{
|
||||
LogPrintf("LOCKCONTENTION: %s\n", pszName);
|
||||
LogPrintf("Locker: %s:%d\n", pszFile, nLine);
|
||||
LogPrintf("LOCKCONTENTION: %s Locker: %s:%d\n", pszName, pszFile, nLine);
|
||||
}
|
||||
#endif /* DEBUG_LOCKCONTENTION */
|
||||
|
||||
|
14
src/util.cpp
14
src/util.cpp
@ -300,7 +300,7 @@ bool LogAcceptCategory(const char* category)
|
||||
/**
|
||||
* fStartedNewLine is a state variable held by the calling context that will
|
||||
* suppress printing of the timestamp when multiple calls are made that don't
|
||||
* end in a newline. Initialize it to true, and hold it, in the calling context.
|
||||
* end in a newline. Initialize it to true, and hold/manage it, in the calling context.
|
||||
*/
|
||||
static std::string LogTimestampStr(const std::string &str, bool *fStartedNewLine)
|
||||
{
|
||||
@ -318,18 +318,13 @@ static std::string LogTimestampStr(const std::string &str, bool *fStartedNewLine
|
||||
} else
|
||||
strStamped = str;
|
||||
|
||||
if (!str.empty() && str[str.size()-1] == '\n')
|
||||
*fStartedNewLine = true;
|
||||
else
|
||||
*fStartedNewLine = false;
|
||||
|
||||
return strStamped;
|
||||
}
|
||||
|
||||
/**
|
||||
* fStartedNewLine is a state variable held by the calling context that will
|
||||
* suppress printing of the thread name when multiple calls are made that don't
|
||||
* end in a newline. Initialize it to true, and hold it, in the calling context.
|
||||
* end in a newline. Initialize it to true, and hold/manage it, in the calling context.
|
||||
*/
|
||||
static std::string LogThreadNameStr(const std::string &str, bool *fStartedNewLine)
|
||||
{
|
||||
@ -356,6 +351,11 @@ int LogPrintStr(const std::string &str)
|
||||
std::string strThreadLogged = LogThreadNameStr(str, &fStartedNewLine);
|
||||
std::string strTimestamped = LogTimestampStr(strThreadLogged, &fStartedNewLine);
|
||||
|
||||
if (!str.empty() && str[str.size()-1] == '\n')
|
||||
fStartedNewLine = true;
|
||||
else
|
||||
fStartedNewLine = false;
|
||||
|
||||
if (fPrintToConsole)
|
||||
{
|
||||
// print to console
|
||||
|
Loading…
Reference in New Issue
Block a user