More logging improvements.

This commit is contained in:
JoelKatz
2012-10-08 07:14:36 -07:00
parent 0355439406
commit 31a6177da0
5 changed files with 23 additions and 16 deletions

View File

@@ -19,6 +19,7 @@
#include "HashPrefixes.h"
#include "Log.h"
SETUP_LOG();
Ledger::Ledger(const NewcoinAddress& masterID, uint64 startAmount) : mTotCoins(startAmount), mLedgerSeq(1),
mCloseTime(0), mParentCloseTime(0), mCloseResolution(LEDGER_TIME_ACCURACY), mCloseFlags(0),
@@ -428,11 +429,13 @@ Ledger::pointer Ledger::getSQL(const std::string& sql)
closeFlags, closeResolution, ledgerSeq);
if (ret->getHash() != ledgerHash)
{
Json::StyledStreamWriter ssw;
Log(lsERROR) << "Failed on ledger";
Json::Value p;
ret->addJson(p, LEDGER_JSON_FULL);
ssw.write(Log(lsERROR).ref(), p);
if (sLog(lsERROR))
{
Log(lsERROR) << "Failed on ledger";
Json::Value p;
ret->addJson(p, LEDGER_JSON_FULL);
Log(lsERROR) << p;
}
assert(false);
return Ledger::pointer();
}