ensure that no double timestamps show up in the debug.log, by removing manual timestamps from the source (now only -logtimestamps parameter adds timestamps to debug.log)

This commit is contained in:
Philip Kaufmann 2012-05-12 00:09:33 +02:00
parent af4006b3f5
commit 0985816bf6
5 changed files with 3 additions and 12 deletions

View File

@ -2267,10 +2267,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{ {
static map<CService, vector<unsigned char> > mapReuseKey; static map<CService, vector<unsigned char> > mapReuseKey;
RandAddSeedPerfmon(); RandAddSeedPerfmon();
if (fDebug) { if (fDebug)
printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
printf("received: %s (%d bytes)\n", strCommand.c_str(), vRecv.size()); printf("received: %s (%d bytes)\n", strCommand.c_str(), vRecv.size());
}
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0) if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
{ {
printf("dropmessagestest DROPPING RECV MESSAGE\n"); printf("dropmessagestest DROPPING RECV MESSAGE\n");
@ -3473,7 +3471,6 @@ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
printf("BitcoinMiner:\n"); printf("BitcoinMiner:\n");
printf("proof-of-work found \n hash: %s \ntarget: %s\n", hash.GetHex().c_str(), hashTarget.GetHex().c_str()); printf("proof-of-work found \n hash: %s \ntarget: %s\n", hash.GetHex().c_str(), hashTarget.GetHex().c_str());
pblock->print(); pblock->print();
printf("%s ", DateTimeStrFormat("%x %H:%M", GetTime()).c_str());
printf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue).c_str()); printf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue).c_str());
// Found a solution // Found a solution
@ -3614,7 +3611,6 @@ void static BitcoinMiner(CWallet *pwallet)
if (GetTime() - nLogTime > 30 * 60) if (GetTime() - nLogTime > 30 * 60)
{ {
nLogTime = GetTime(); nLogTime = GetTime();
printf("%s ", DateTimeStrFormat("%x %H:%M", GetTime()).c_str());
printf("hashmeter %3d CPUs %6.0f khash/s\n", vnThreadsRunning[THREAD_MINER], dHashesPerSec/1000.0); printf("hashmeter %3d CPUs %6.0f khash/s\n", vnThreadsRunning[THREAD_MINER], dHashesPerSec/1000.0);
} }
} }

View File

@ -516,8 +516,6 @@ void CNode::CloseSocketDisconnect()
fDisconnect = true; fDisconnect = true;
if (hSocket != INVALID_SOCKET) if (hSocket != INVALID_SOCKET)
{ {
if (fDebug)
printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
printf("disconnecting node %s\n", addrName.c_str()); printf("disconnecting node %s\n", addrName.c_str());
closesocket(hSocket); closesocket(hSocket);
hSocket = INVALID_SOCKET; hSocket = INVALID_SOCKET;

View File

@ -318,11 +318,9 @@ public:
nHeaderStart = vSend.size(); nHeaderStart = vSend.size();
vSend << CMessageHeader(pszCommand, 0); vSend << CMessageHeader(pszCommand, 0);
nMessageStart = vSend.size(); nMessageStart = vSend.size();
if (fDebug) { if (fDebug)
printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
printf("sending: %s ", pszCommand); printf("sending: %s ", pszCommand);
} }
}
void AbortMessage() void AbortMessage()
{ {

View File

@ -147,7 +147,7 @@ void RandAddSeedPerfmon()
{ {
RAND_add(pdata, nSize, nSize/100.0); RAND_add(pdata, nSize, nSize/100.0);
memset(pdata, 0, nSize); memset(pdata, 0, nSize);
printf("%s RandAddSeed() %d bytes\n", DateTimeStrFormat("%x %H:%M", GetTime()).c_str(), nSize); printf("RandAddSeed() %d bytes\n", nSize);
} }
#endif #endif
} }

View File

@ -367,7 +367,6 @@ void ThreadFlushWalletDB(void* parg)
map<string, int>::iterator mi = mapFileUseCount.find(strFile); map<string, int>::iterator mi = mapFileUseCount.find(strFile);
if (mi != mapFileUseCount.end()) if (mi != mapFileUseCount.end())
{ {
printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
printf("Flushing wallet.dat\n"); printf("Flushing wallet.dat\n");
nLastFlushed = nWalletDBUpdated; nLastFlushed = nWalletDBUpdated;
int64 nStart = GetTimeMillis(); int64 nStart = GetTimeMillis();