Auto merge of #1584 - bitcartel:1504_zca_011_logging, r=daira

More granular control over logging of z_* calls

Closes #1504
This commit is contained in:
zkbot
2016-10-21 21:32:46 -04:00
2 changed files with 20 additions and 1 deletions

View File

@@ -780,7 +780,8 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() {
for (CNotePlaintextEntry & entry : entries) {
z_inputs_.push_back(SendManyInputJSOP(entry.jsop, entry.plaintext.note(frompaymentaddress_), CAmount(entry.plaintext.value)));
std::string data(entry.plaintext.memo.begin(), entry.plaintext.memo.end());
LogPrint("zrpc", "%s: found unspent note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, memo=%s)\n",
if (LogAcceptCategory("zrpcunsafe")) {
LogPrint("zrpcunsafe", "%s: found unspent note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, memo=%s)\n",
getId().substr(0, 10),
entry.jsop.hash.ToString().substr(0, 10),
entry.jsop.js,
@@ -788,6 +789,15 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() {
FormatMoney(entry.plaintext.value, false),
HexStr(data).substr(0, 10)
);
} else {
LogPrint("zrpc", "%s: found unspent note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s)\n",
getId().substr(0, 10),
entry.jsop.hash.ToString().substr(0, 10),
entry.jsop.js,
int(entry.jsop.n), // uint8_t
FormatMoney(entry.plaintext.value, false)
);
}
}
if (z_inputs_.size() == 0) {