Reduce log chattiness.

This commit is contained in:
JoelKatz
2012-06-18 22:22:47 -07:00
parent ea837ff819
commit 4afa11a6a6
3 changed files with 13 additions and 17 deletions

View File

@@ -506,7 +506,7 @@ void LedgerConsensus::startAcquiring(TransactionAcquire::pointer acquire)
void LedgerConsensus::propose(const std::vector<uint256>& added, const std::vector<uint256>& 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

View File

@@ -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;

View File

@@ -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"