easylogger added to RPCCalls

new_rpc
moneroexamples 5 years ago
parent 0772b01431
commit d95a811867

@ -2,6 +2,9 @@
// Created by mwo on 13/04/16. // Created by mwo on 13/04/16.
// //
#include "easylogging++.h"
#include "om_log.h"
#include "RPCCalls.h" #include "RPCCalls.h"
namespace xmreg namespace xmreg
@ -61,7 +64,7 @@ RPCCalls::commit_tx(
error_msg = "Reason not given by daemon."; error_msg = "Reason not given by daemon.";
} }
cerr << "Error sending tx: " << error_msg << endl; OMERROR << "Error sending tx: " << error_msg;
return false; return false;
} }
@ -70,7 +73,7 @@ RPCCalls::commit_tx(
{ {
error_msg = "Deamon is BUSY. Cant sent now " + res.reason; error_msg = "Deamon is BUSY. Cant sent now " + res.reason;
cerr << "Error sending tx: " << error_msg << endl; OMERROR << "Error sending tx: " << error_msg;
return false; return false;
} }
@ -79,14 +82,16 @@ RPCCalls::commit_tx(
{ {
error_msg = "Tx rejected: " + res.reason; error_msg = "Tx rejected: " + res.reason;
cerr << "Error sending tx: " << error_msg << endl; OMERROR << "Error sending tx: " << error_msg;
return false; return false;
} }
if (do_not_relay) if (do_not_relay)
{ {
cout << "Tx accepted by deamon but not relayed (useful for testing of constructing txs)" << endl; OMINFO << "Tx accepted by deamon but "
"not relayed (useful for testing "
"of constructing txs)";
} }
return true; return true;
@ -124,8 +129,8 @@ RPCCalls::get_current_height(uint64_t& current_height)
if (!r) if (!r)
{ {
cerr << "Error connecting to Monero deamon at " OMERROR << "Error connecting to Monero deamon at "
<< deamon_url << endl; << deamon_url;
return false; return false;
} }

Loading…
Cancel
Save