From a1a12682abf31439ffb97852255b3e7d4f6bfdff Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sun, 10 Feb 2013 21:49:08 -0800 Subject: [PATCH] More verbose logging about subscribing. --- src/cpp/ripple/RPCHandler.cpp | 7 ++++++- src/cpp/ripple/RPCSub.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/cpp/ripple/RPCHandler.cpp b/src/cpp/ripple/RPCHandler.cpp index 55ff10a56..dc0712efe 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -2401,10 +2401,14 @@ Json::Value RPCHandler::doSubscribe(Json::Value jvRequest) RPCSub *rspSub = mNetOps->findRpcSub(strUrl); if (!rspSub) { + cLog(lsINFO) << boost::str(boost::format("doSubscribe: building: %s") % strUrl); + rspSub = mNetOps->addRpcSub(strUrl, new RPCSub(strUrl, strUsername, strPassword)); } else { + cLog(lsINFO) << boost::str(boost::format("doSubscribe: reusing: %s") % strUrl); + if (jvRequest.isMember("username")) rspSub->setUsername(strUsername); @@ -2430,7 +2434,6 @@ Json::Value RPCHandler::doSubscribe(Json::Value jvRequest) if (streamName=="server") { mNetOps->subServer(ispSub, jvResult); - } else if (streamName=="ledger") { @@ -2483,6 +2486,8 @@ Json::Value RPCHandler::doSubscribe(Json::Value jvRequest) else { mNetOps->subAccount(ispSub, usnaAccoundIds, uLedgerIndex, false); + + cLog(lsINFO) << boost::str(boost::format("doSubscribe: accounts: %d") % usnaAccoundIds.size()); } } diff --git a/src/cpp/ripple/RPCSub.cpp b/src/cpp/ripple/RPCSub.cpp index 28daff00e..50dfb061f 100644 --- a/src/cpp/ripple/RPCSub.cpp +++ b/src/cpp/ripple/RPCSub.cpp @@ -67,7 +67,7 @@ void RPCSub::sendThread() // XXX Might not need this in a try. try { - cLog(lsDEBUG) << boost::str(boost::format("callRPC calling: %s") % mIp); + cLog(lsINFO) << boost::str(boost::format("callRPC calling: %s") % mIp); callRPC( theApp->getIOService(), @@ -79,7 +79,7 @@ void RPCSub::sendThread() } catch (const std::exception& e) { - cLog(lsDEBUG) << boost::str(boost::format("callRPC exception: %s") % e.what()); + cLog(lsINFO) << boost::str(boost::format("callRPC exception: %s") % e.what()); } } } while (bSend); @@ -93,11 +93,11 @@ void RPCSub::send(const Json::Value& jvObj) { // Drop the previous event. - cLog(lsDEBUG) << boost::str(boost::format("callRPC drop")); + cLog(lsWARNING) << boost::str(boost::format("callRPC drop")); mDeque.pop_back(); } - cLog(lsDEBUG) << boost::str(boost::format("callRPC push: %s") % jvObj); + cLog(lsINFO) << boost::str(boost::format("callRPC push: %s") % jvObj); mDeque.push_back(std::make_pair(mSeq++, jvObj)); @@ -106,7 +106,7 @@ void RPCSub::send(const Json::Value& jvObj) // Start a sending thread. mSending = true; - cLog(lsDEBUG) << boost::str(boost::format("callRPC start")); + cLog(lsINFO) << boost::str(boost::format("callRPC start")); boost::thread(boost::bind(&RPCSub::sendThread, this)).detach(); } }