Use log/journal instead of std::cerr (RIPD-1377):

Change some uses of std::cerr to log or cout.
This commit is contained in:
Mike Ellery
2017-01-06 13:08:08 -08:00
committed by Edward Hennis
parent b3eada1dc2
commit e01f6e7455
10 changed files with 101 additions and 23 deletions

View File

@@ -1297,8 +1297,9 @@ rpcClient(std::vector<std::string> const& args,
ServerHandler::Setup setup;
try
{
std::stringstream ss;
setup = setup_ServerHandler(config, ss);
setup = setup_ServerHandler(
config,
beast::logstream { logs.journal ("HTTPClient").warn() });
}
catch (std::exception const&)
{
@@ -1429,10 +1430,12 @@ void fromNetwork (
Logs& logs,
std::function<void (Json::Value const& jvInput)> callbackFuncP)
{
auto j = logs.journal ("HTTPClient");
// Connect to localhost
if (!quiet)
{
std::cerr << (bSSL ? "Securely connecting to " : "Connecting to ") <<
JLOG(j.info()) << (bSSL ? "Securely connecting to " : "Connecting to ") <<
strIp << ":" << iPort << std::endl;
}
@@ -1449,8 +1452,6 @@ void fromNetwork (
using namespace std::chrono_literals;
auto constexpr RPC_NOTIFY = 10min;
auto j = logs.journal ("HTTPClient");
HTTPClient::request (
bSSL,
io_service,
@@ -1467,7 +1468,7 @@ void fromNetwork (
std::bind (&RPCCallImp::onResponse, callbackFuncP,
std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3, j),
logs);
j);
}
} // RPCCall