From 881a85a22d76c875f519cd54388a419ec6f70857 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 18 Sep 2013 20:38:08 +1000 Subject: Replace printf with LogPrintf / LogPrint --- src/net.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/net.h') diff --git a/src/net.h b/src/net.h index 686861fbeb..49415f6502 100644 --- a/src/net.h +++ b/src/net.h @@ -372,8 +372,7 @@ public: nRequestTime = it->second; else nRequestTime = 0; - if (fDebugNet) - printf("askfor %s %"PRI64d" (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str()); + LogPrint("net", "askfor %s %"PRI64d" (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str()); // Make sure not to reuse time indexes to keep things in the same order int64 nNow = (GetTime() - 1) * 1000000; @@ -399,8 +398,7 @@ public: ENTER_CRITICAL_SECTION(cs_vSend); assert(ssSend.size() == 0); ssSend << CMessageHeader(pszCommand, 0); - if (fDebug) - printf("sending: %s ", pszCommand); + LogPrint("net", "sending: %s ", pszCommand); } // TODO: Document the precondition of this function. Is cs_vSend locked? @@ -410,8 +408,7 @@ public: LEAVE_CRITICAL_SECTION(cs_vSend); - if (fDebug) - printf("(aborted)\n"); + LogPrint("net", "(aborted)\n"); } // TODO: Document the precondition of this function. Is cs_vSend locked? @@ -419,7 +416,7 @@ public: { if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0) { - printf("dropmessages DROPPING SEND MESSAGE\n"); + LogPrint("net", "dropmessages DROPPING SEND MESSAGE\n"); AbortMessage(); return; } @@ -438,9 +435,7 @@ public: assert(ssSend.size () >= CMessageHeader::CHECKSUM_OFFSET + sizeof(nChecksum)); memcpy((char*)&ssSend[CMessageHeader::CHECKSUM_OFFSET], &nChecksum, sizeof(nChecksum)); - if (fDebug) { - printf("(%d bytes)\n", nSize); - } + LogPrint("net", "(%d bytes)\n", nSize); std::deque::iterator it = vSendMsg.insert(vSendMsg.end(), CSerializeData()); ssSend.GetAndClear(*it); -- cgit v1.2.3