Skip to content

Commit 5c21e6c

Browse files
committed
[logging] Comment all continuing logs.
Most logs should terminated with a '\n'. Some logs are built up over multiple calls to logPrintf(), so do not need a newline terminater. Comment all of these 'continued' logs as a linter hing.
1 parent 2b54155 commit 5c21e6c

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/dbwrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CBitcoinLevelDBLogger : public leveldb::Logger {
6363

6464
assert(p <= limit);
6565
base[std::min(bufsize - 1, (int)(p - base))] = '\0';
66-
LogPrintf("leveldb: %s", base);
66+
LogPrintf("leveldb: %s", base); /* Continued */
6767
if (base != buffer) {
6868
delete[] base;
6969
}

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ bool AppInitMain()
12151215

12161216
// Warn about relative -datadir path.
12171217
if (gArgs.IsArgSet("-datadir") && !fs::path(gArgs.GetArg("-datadir", "")).is_absolute()) {
1218-
LogPrintf("Warning: relative datadir option '%s' specified, which will be interpreted relative to the "
1218+
LogPrintf("Warning: relative datadir option '%s' specified, which will be interpreted relative to the " /* Continued */
12191219
"current working directory '%s'. This is fragile, because if bitcoin is started in the future "
12201220
"from a different location, it will be unable to locate the current data files. There could "
12211221
"also be data loss if bitcoin is started while in a temporary directory.\n",

src/sync.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,20 @@ static void potential_deadlock_detected(const std::pair<void*, void*>& mismatch,
8181
LogPrintf("Previous lock order was:\n");
8282
for (const std::pair<void*, CLockLocation> & i : s2) {
8383
if (i.first == mismatch.first) {
84-
LogPrintf(" (1)");
84+
LogPrintf(" (1)"); /* Continued */
8585
}
8686
if (i.first == mismatch.second) {
87-
LogPrintf(" (2)");
87+
LogPrintf(" (2)"); /* Continued */
8888
}
8989
LogPrintf(" %s\n", i.second.ToString());
9090
}
9191
LogPrintf("Current lock order is:\n");
9292
for (const std::pair<void*, CLockLocation> & i : s1) {
9393
if (i.first == mismatch.first) {
94-
LogPrintf(" (1)");
94+
LogPrintf(" (1)"); /* Continued */
9595
}
9696
if (i.first == mismatch.second) {
97-
LogPrintf(" (2)");
97+
LogPrintf(" (2)"); /* Continued */
9898
}
9999
LogPrintf(" %s\n", i.second.ToString());
100100
}

src/txdb.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ bool CCoinsViewDB::Upgrade() {
370370

371371
int64_t count = 0;
372372
LogPrintf("Upgrading utxo-set database...\n");
373-
LogPrintf("[0%%]...");
373+
LogPrintf("[0%%]..."); /* Continued */
374374
uiInterface.ShowProgress(_("Upgrading UTXO database"), 0, true);
375375
size_t batch_size = 1 << 24;
376376
CDBBatch batch(db);
@@ -389,7 +389,7 @@ bool CCoinsViewDB::Upgrade() {
389389
uiInterface.ShowProgress(_("Upgrading UTXO database"), percentageDone, true);
390390
if (reportDone < percentageDone/10) {
391391
// report max. every 10% step
392-
LogPrintf("[%d%%]...", percentageDone);
392+
LogPrintf("[%d%%]...", percentageDone); /* Continued */
393393
reportDone = percentageDone/10;
394394
}
395395
}

src/validation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,13 +2231,13 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
22312231
DoWarning(strWarning);
22322232
}
22332233
}
2234-
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__,
2234+
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__, /* Continued */
22352235
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, pindexNew->nVersion,
22362236
log(pindexNew->nChainWork.getdouble())/log(2.0), (unsigned long)pindexNew->nChainTx,
22372237
FormatISO8601DateTime(pindexNew->GetBlockTime()),
22382238
GuessVerificationProgress(chainParams.TxData(), pindexNew), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize());
22392239
if (!warningMessages.empty())
2240-
LogPrintf(" warning='%s'", boost::algorithm::join(warningMessages, ", "));
2240+
LogPrintf(" warning='%s'", boost::algorithm::join(warningMessages, ", ")); /* Continued */
22412241
LogPrintf("\n");
22422242

22432243
}
@@ -3903,14 +3903,14 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
39033903
int nGoodTransactions = 0;
39043904
CValidationState state;
39053905
int reportDone = 0;
3906-
LogPrintf("[0%%]...");
3906+
LogPrintf("[0%%]..."); /* Continued */
39073907
for (CBlockIndex* pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev)
39083908
{
39093909
boost::this_thread::interruption_point();
39103910
int percentageDone = std::max(1, std::min(99, (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))));
39113911
if (reportDone < percentageDone/10) {
39123912
// report every 10% step
3913-
LogPrintf("[%d%%]...", percentageDone);
3913+
LogPrintf("[%d%%]...", percentageDone); /* Continued */
39143914
reportDone = percentageDone/10;
39153915
}
39163916
uiInterface.ShowProgress(_("Verifying blocks..."), percentageDone, false);

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3076,7 +3076,7 @@ bool CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::ve
30763076
wtxNew.fTimeReceivedIsTxTime = true;
30773077
wtxNew.fFromMe = true;
30783078

3079-
LogPrintf("CommitTransaction:\n%s", wtxNew.tx->ToString());
3079+
LogPrintf("CommitTransaction:\n%s", wtxNew.tx->ToString()); /* Continued */
30803080
{
30813081
// Take key pair from key pool so it won't be used again
30823082
reservekey.KeepKey();

0 commit comments

Comments
 (0)