mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Squelch logs in Env (RIPD-982)
This commit is contained in:
committed by
Vinnie Falco
parent
af36942e1f
commit
70ccdabf7c
@@ -145,8 +145,6 @@ public:
|
||||
}
|
||||
void run ()
|
||||
{
|
||||
// Hack to silence logging
|
||||
deprecatedLogs ().severity (beast::Journal::Severity::kNone);
|
||||
testCanceledOffer ();
|
||||
testRmFundedOffer ();
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -574,10 +574,6 @@ public:
|
||||
void
|
||||
run()
|
||||
{
|
||||
// Hack to silence logging
|
||||
deprecatedLogs().severity(
|
||||
beast::Journal::Severity::kNone);
|
||||
|
||||
testAccount();
|
||||
testAmount();
|
||||
testEnv();
|
||||
|
||||
Reference in New Issue
Block a user