hpp-util  4.9.0
Debugging tools for the HPP project.
Macros for logging

Macros

#define hppDout(channel, data)
 Write data to channel when HPP_DEBUG is defined. More...
 
#define hppDoutFatal(channel, data)
 Write data to channel and exit the program. More...
 
#define HPP_DEFINE_TIMECOUNTER(name)   ::hpp::debug::TimeCounter _##name##_timecounter_ (#name)
 Define a new TimeCounter. More...
 
#define HPP_SCOPE_TIMECOUNTER(name)
 Compute the time spent in the current scope. More...
 
#define HPP_START_TIMECOUNTER(name)   _##name##_timecounter_.start ()
 Start a watch. More...
 
#define HPP_STOP_TIMECOUNTER(name)   _##name##_timecounter_.stop()
 Stop a watch and save elapsed time. More...
 
#define HPP_DISPLAY_LAST_TIMECOUNTER(name)
 Print last elapsed time to the logs. More...
 
#define HPP_DISPLAY_TIMECOUNTER(name)
 Print min, max and mean time of the time measurements. More...
 
#define HPP_RESET_TIMECOUNTER(name)   _##name##_timecounter_.reset();
 Reset a TimeCounter. More...
 
#define HPP_STREAM_TIMECOUNTER(os, name)   os << _##name##_timecounter_
 Stream (operator<<) to the output stream. More...
 

Detailed Description

Macro Definition Documentation

◆ HPP_DEFINE_TIMECOUNTER

#define HPP_DEFINE_TIMECOUNTER (   name)    ::hpp::debug::TimeCounter _##name##_timecounter_ (#name)

Define a new TimeCounter.

◆ HPP_DISPLAY_LAST_TIMECOUNTER

#define HPP_DISPLAY_LAST_TIMECOUNTER (   name)
Value:
do { \
using namespace hpp; \
using namespace ::hpp::debug; \
std::stringstream __ss; \
__ss << #name << " last: " \
<< _##name##_timecounter_.last() << iendl; \
logging.benchmark.write (__FILE__, __LINE__, \
__PRETTY_FUNCTION__, __ss); \
} while (0)
Definition: assertion.hh:24
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
Definition: indent.cc:54

Print last elapsed time to the logs.

◆ HPP_DISPLAY_TIMECOUNTER

#define HPP_DISPLAY_TIMECOUNTER (   name)
Value:
do { \
using namespace hpp; \
using namespace ::hpp::debug; \
std::stringstream __ss; \
__ss << _##name##_timecounter_ << iendl; \
logging.benchmark.write (__FILE__, __LINE__, \
__PRETTY_FUNCTION__, __ss); \
} while (0)
Definition: assertion.hh:24
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
Definition: indent.cc:54

Print min, max and mean time of the time measurements.

◆ HPP_RESET_TIMECOUNTER

#define HPP_RESET_TIMECOUNTER (   name)    _##name##_timecounter_.reset();

Reset a TimeCounter.

◆ HPP_SCOPE_TIMECOUNTER

#define HPP_SCOPE_TIMECOUNTER (   name)
Value:
::hpp::debug::TimeCounter::Scope _##name##_scopetimecounter_ \
(_##name##_timecounter_)
Definition: timer.hh:95

Compute the time spent in the current scope.

◆ HPP_START_TIMECOUNTER

#define HPP_START_TIMECOUNTER (   name)    _##name##_timecounter_.start ()

Start a watch.

◆ HPP_STOP_TIMECOUNTER

#define HPP_STOP_TIMECOUNTER (   name)    _##name##_timecounter_.stop()

Stop a watch and save elapsed time.

◆ HPP_STREAM_TIMECOUNTER

#define HPP_STREAM_TIMECOUNTER (   os,
  name 
)    os << _##name##_timecounter_

Stream (operator<<) to the output stream.

◆ hppDout

#define hppDout (   channel,
  data 
)
Value:
do { \
using namespace hpp; \
using namespace ::hpp::debug; \
std::stringstream __ss; \
__ss << data << iendl; \
logging.channel.write (__FILE__, __LINE__, __PRETTY_FUNCTION__, \
__ss); \
} while (0)
Definition: assertion.hh:24
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
Definition: indent.cc:54

Write data to channel when HPP_DEBUG is defined.

Parameters
channelone of error, warning, notice, info or benchmark.
dataa statement that can be << to a std::stringstream.

◆ hppDoutFatal

#define hppDoutFatal (   channel,
  data 
)
Value:
do { \
using namespace hpp; \
using namespace ::hpp::debug; \
std::stringstream __ss; \
__ss << data << iendl; \
logging.channel.write ( __FILE__, __LINE__, __PRETTY_FUNCTION__, \
__ss); \
::std::exit(EXIT_FAILURE); \
} while (1)
Definition: assertion.hh:24
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
Definition: indent.cc:54

Write data to channel and exit the program.

Parameters
channelone of error, warning, notice, info or benchmark.
dataa statement that can be << to a std::stringstream.