CatapultServer  v0.5.0.1 (Elephant)
ThrottleLogger.h File Reference
Include dependency graph for ThrottleLogger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  catapult::utils::ThrottleLogger
 

Namespaces

 catapult
 
 catapult::utils
 

Macros

#define CATAPULT_LOG_THROTTLE(LEVEL, THROTTLE_MILLIS)
 

Macro Definition Documentation

◆ CATAPULT_LOG_THROTTLE

#define CATAPULT_LOG_THROTTLE (   LEVEL,
  THROTTLE_MILLIS 
)
Value:
static utils::ThrottleLogger BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(throttle_logger, __LINE__)(THROTTLE_MILLIS); \
if (!BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(throttle_logger, __LINE__).isThrottled()) \
CATAPULT_LOG(LEVEL) << "[" << BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(throttle_logger, __LINE__).counter() << " log count] "

Logs a throttled message at LEVEL at most every THROTTLE_MILLIS milliseconds.

Note
THROTTLE_MILLIS must be a compile time constant or behavior is undefined.