Squelch logs in Env (RIPD-982)

This commit is contained in:
Miguel Portilla
2015-07-17 13:25:58 -04:00
committed by Vinnie Falco
parent af36942e1f
commit 70ccdabf7c
4 changed files with 21 additions and 9 deletions

View File

@@ -145,8 +145,6 @@ public:
}
void run ()
{
// Hack to silence logging
deprecatedLogs ().severity (beast::Journal::Severity::kNone);
testCanceledOffer ();
testRmFundedOffer ();
}

View File

@@ -219,7 +219,6 @@ private:
beast::Journal::Severity severity, std::string const& partition);
};
// Wraps a Journal::Stream to skip evaluation of
// expensive argument lists if the stream is not active.
#ifndef JLOG
@@ -236,6 +235,25 @@ deprecatedLogs()
return logs;
}
class LogSquelcher
{
public:
LogSquelcher()
: severity_(deprecatedLogs().severity())
{
deprecatedLogs().severity(
beast::Journal::Severity::kNone);
}
~LogSquelcher()
{
deprecatedLogs().severity(severity_);
}
private:
beast::Journal::Severity const severity_;
};
// VFALCO DEPRECATED Inject beast::Journal instead
#define ShouldLog(s, k) \
::ripple::deprecatedLogs()[#k].active(::ripple::Logs::toSeverity (s))

View File

@@ -135,12 +135,12 @@ public:
private:
std::shared_ptr<Ledger const> closed_;
CachedSLEs cachedSLEs_;
public:
LogSquelcher logSquelcher_;
public:
// Careful with this
OpenLedger openLedger;
public:
Env() = delete;
Env (Env const&) = delete;
Env& operator= (Env const&) = delete;

View File

@@ -574,10 +574,6 @@ public:
void
run()
{
// Hack to silence logging
deprecatedLogs().severity(
beast::Journal::Severity::kNone);
testAccount();
testAmount();
testEnv();