diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index 3193dd7582..1742148129 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -506,7 +506,7 @@ void LedgerConsensus::startAcquiring(TransactionAcquire::pointer acquire) void LedgerConsensus::propose(const std::vector& added, const std::vector& removed) { - Log(lsDEBUG) << "We propose: " << mOurPosition->getCurrentHash().GetHex(); + Log(lsTRACE) << "We propose: " << mOurPosition->getCurrentHash().GetHex(); newcoin::TMProposeSet prop; prop.set_currenttxhash(mOurPosition->getCurrentHash().begin(), 256 / 8); prop.set_proposeseq(mOurPosition->getProposeSeq()); @@ -643,7 +643,7 @@ void LedgerConsensus::applyTransaction(TransactionEngine& engine, SerializedTran } else if (result == 0) { - Log(lsDEBUG) << " success"; + Log(lsTRACE) << " success"; assert(ledger->hasTransaction(txn->getTransactionID())); } else @@ -729,7 +729,7 @@ void LedgerConsensus::accept(SHAMap::pointer set) Log(lsTRACE) << "newLCL before transactions"; Json::Value p; newLCL->addJson(p, LEDGER_JSON_DUMP_TXNS | LEDGER_JSON_DUMP_STATE); - ssw.write(std::cerr, p); + ssw.write(Log(lsTRACE).ref(), p); } #endif @@ -747,7 +747,7 @@ void LedgerConsensus::accept(SHAMap::pointer set) Log(lsTRACE) << "newLCL after transactions"; Json::Value p; newLCL->addJson(p, LEDGER_JSON_DUMP_TXNS | LEDGER_JSON_DUMP_STATE); - ssw.write(std::cerr, p); + ssw.write(Log(lsTRACE).ref(), p); } #endif @@ -759,14 +759,14 @@ void LedgerConsensus::accept(SHAMap::pointer set) Log(lsTRACE) << "newOL before transactions"; Json::Value p; newOL->addJson(p, LEDGER_JSON_DUMP_TXNS | LEDGER_JSON_DUMP_STATE); - ssw.write(std::cerr, p); + ssw.write(Log(lsTRACE).ref(), p); } if (1) { Log(lsTRACE) << "current ledger"; Json::Value p; theApp->getMasterLedger().getCurrentLedger()->addJson(p, LEDGER_JSON_DUMP_TXNS | LEDGER_JSON_DUMP_STATE); - ssw.write(std::cerr, p); + ssw.write(Log(lsTRACE).ref(), p); } #endif @@ -804,7 +804,7 @@ void LedgerConsensus::accept(SHAMap::pointer set) Log(lsTRACE) << "newOL after current ledger transactions"; Json::Value p; newOL->addJson(p, LEDGER_JSON_DUMP_TXNS | LEDGER_JSON_DUMP_STATE); - ssw.write(std::cerr, p); + ssw.write(Log(lsTRACE).ref(), p); } #endif diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index 0395d52a2a..b524681f6e 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -23,6 +23,7 @@ #include "AccountState.h" #include "NicknameState.h" #include "utils.h" +#include "Log.h" RPCServer::RPCServer(boost::asio::io_service& io_service , NetworkOPs* nopNetwork) : mNetOps(nopNetwork), mSocket(io_service) @@ -162,16 +163,10 @@ std::string RPCServer::handleRequest(const std::string& requestStr) else if (!valParams.isArray()) return(HTTPReply(400, "")); -#ifdef DEBUG Json::StyledStreamWriter w; - w.write(std::cerr, valParams); -#endif - + w.write(Log(lsTRACE).ref(), valParams); Json::Value result(doCommand(strMethod, valParams)); - -#ifdef DEBUG - w.write(std::cerr, result); -#endif + w.write(Log(lsTRACE).ref(), result); std::string strReply = JSONRPCReply(result, Json::Value(), id); return( HTTPReply(200, strReply) ); @@ -1966,7 +1961,7 @@ Json::Value RPCServer::doStop(Json::Value& params) { Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params) { - std::cerr << "RPC:" << command << std::endl; + Log(lsTRACE) << "RPC:" << command; static struct { const char* pCommand; diff --git a/src/rpc.cpp b/src/rpc.cpp index b55ea15672..77a414cc4b 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -14,6 +14,7 @@ #include "RPC.h" #include "BitcoinUtil.h" #include "Config.h" +#include "Log.h" using namespace boost; using namespace boost::asio; @@ -71,7 +72,7 @@ std::string rfc1123Time() std::string HTTPReply(int nStatus, const std::string& strMsg) { - std::cout << "HTTP Reply " << nStatus << " " << strMsg << std::endl; + Log(lsTRACE) << "HTTP Reply " << nStatus << " " << strMsg; if (nStatus == 401) return strprintf("HTTP/1.0 401 Authorization Required\r\n"