mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add JLOG macro
This commit is contained in:
@@ -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); \
|
||||
|
||||
Reference in New Issue
Block a user