Inject journals:

Calls to WriteLog are replaced with injected journals
This commit is contained in:
seelabs
2015-09-19 11:06:12 -07:00
committed by Vinnie Falco
parent df6ac8f7f5
commit 92b2ca70b7
131 changed files with 1336 additions and 1076 deletions

View File

@@ -119,7 +119,7 @@ error_code_i fillHandler (Context& context,
int jc = context.app.getJobQueue ().getJobCountGE (jtCLIENT);
if (jc > Tuning::maxJobQueueClients)
{
WriteLog (lsDEBUG, RPCHandler) << "Too busy for command: " << jc;
JLOG (context.j.debug) << "Too busy for command: " << jc;
return rpcTOO_BUSY;
}
}
@@ -129,8 +129,8 @@ error_code_i fillHandler (Context& context,
std::string strCommand = context.params[jss::command].asString ();
WriteLog (lsTRACE, RPCHandler) << "COMMAND:" << strCommand;
WriteLog (lsTRACE, RPCHandler) << "REQUEST:" << context.params;
JLOG (context.j.trace) << "COMMAND:" << strCommand;
JLOG (context.j.trace) << "REQUEST:" << context.params;
auto handler = getHandler(strCommand);
@@ -143,7 +143,7 @@ error_code_i fillHandler (Context& context,
if ((handler->condition_ & NEEDS_NETWORK_CONNECTION) &&
(context.netOps.getOperatingMode () < NetworkOPs::omSYNCING))
{
WriteLog (lsINFO, RPCHandler)
JLOG (context.j.info)
<< "Insufficient network mode for RPC: "
<< context.netOps.strOperatingMode ();
@@ -164,7 +164,7 @@ error_code_i fillHandler (Context& context,
if (cID + 10 < vID)
{
WriteLog (lsDEBUG, RPCHandler) << "Current ledger ID(" << cID <<
JLOG (context.j.debug) << "Current ledger ID(" << cID <<
") is less than validated ledger ID(" << vID << ")";
return rpcNO_CURRENT;
}
@@ -192,7 +192,7 @@ Status callMethod (
}
catch (std::exception& e)
{
WriteLog (lsINFO, RPCHandler) << "Caught throw: " << e.what ();
JLOG (context.j.info) << "Caught throw: " << e.what ();
if (context.loadType == Resource::feeReferenceRPC)
context.loadType = Resource::feeExceptionRPC;
@@ -209,7 +209,7 @@ void getResult (
auto&& result = Json::addObject (object, jss::result);
if (auto status = callMethod (context, method, name, result))
{
WriteLog (lsDEBUG, RPCErr) << "rpcError: " << status.toString();
JLOG (context.j.debug) << "rpcError: " << status.toString();
result[jss::status] = jss::error;
result[jss::request] = context.params;
}