Add JLOG macro

This commit is contained in:
Vinnie Falco
2015-06-27 20:49:37 -07:00
parent af52276cd9
commit e595fd5e02

View File

@@ -219,6 +219,13 @@ 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
#define JLOG(x) if((x))(x)
#endif
//------------------------------------------------------------------------------
// VFALCO DEPRECATED Temporary transition function until interfaces injected
inline
@@ -233,13 +240,14 @@ deprecatedLogs()
#define ShouldLog(s, k) \
::ripple::deprecatedLogs()[#k].active(::ripple::Logs::toSeverity (s))
// DEPRECATED
#define WriteLog(s, k) \
if (!ShouldLog(s, k)) \
do {} while (0); \
else \
::beast::Journal::Stream (::ripple::deprecatedLogs()[#k], \
::ripple::Logs::toSeverity(s))
// DEPRECATED
#define CondLog(c, s, k) \
if (!ShouldLog(s, k) || !(c)) \
do {} while(0); \