CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::SlowOperationLogger Class Reference

Simple RAII class that logs slow operation messages. More...

Collaboration diagram for catapult::utils::SlowOperationLogger:

Public Member Functions

 SlowOperationLogger (const char *message, LogLevel level, const TimeSpan &threshold=TimeSpan::FromSeconds(1))
 Constructs a logger with a message and log level for messages longer than threshold. More...
 
 ~SlowOperationLogger ()
 Destructor. More...
 

Private Attributes

const char * m_message
 
LogLevel m_level
 
TimeSpan m_threshold
 
StackTimer m_timer
 

Detailed Description

Simple RAII class that logs slow operation messages.

Constructor & Destructor Documentation

◆ SlowOperationLogger()

catapult::utils::SlowOperationLogger::SlowOperationLogger ( const char *  message,
LogLevel  level,
const TimeSpan threshold = TimeSpan::FromSeconds(1) 
)
inline

Constructs a logger with a message and log level for messages longer than threshold.

◆ ~SlowOperationLogger()

catapult::utils::SlowOperationLogger::~SlowOperationLogger ( )
inline

Destructor.

Here is the call graph for this function:

Member Data Documentation

◆ m_level

LogLevel catapult::utils::SlowOperationLogger::m_level
private

◆ m_message

const char* catapult::utils::SlowOperationLogger::m_message
private

◆ m_threshold

TimeSpan catapult::utils::SlowOperationLogger::m_threshold
private

◆ m_timer

StackTimer catapult::utils::SlowOperationLogger::m_timer
private

The documentation for this class was generated from the following file: