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

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

Define a new 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)
HPP_UTIL_DLLAPI Logging logging
Benchmark information.
Definition: debug.cc:309
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
Definition: indent.cc:54
void write(char const *file, int line, char const *function, const std::string &data)
Definition: debug.cc:143
Definition: assertion.hh:24
Channel benchmark
Benchmark information.
Definition: debug.hh:220

Print last elapsed time to the logs.

#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)
HPP_UTIL_DLLAPI Logging logging
Benchmark information.
Definition: debug.cc:309
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
Definition: indent.cc:54
void write(char const *file, int line, char const *function, const std::string &data)
Definition: debug.cc:143
Definition: assertion.hh:24
Channel benchmark
Benchmark information.
Definition: debug.hh:220

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

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

Reset a 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.

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

Start a watch.

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

Stop a watch and save elapsed time.

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

Stream (operator<<) to the output stream.

#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)
HPP_UTIL_DLLAPI Logging logging
Benchmark information.
Definition: debug.cc:309
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
Definition: indent.cc:54
Definition: assertion.hh:24

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.

Referenced by hpp::util::parser::Parser::addObjectFactory(), hpp::util::parser::SequenceFactory< ValueType >::addTextChild(), hpp::Exception::Exception(), hpp::util::parser::ObjectFactory::getAttribute(), hpp::util::parser::ObjectFactory::getChildOfType(), hpp::util::parser::Parser::parseFile(), and hpp::util::parser::ObjectFactory::setAttribute().

#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)
HPP_UTIL_DLLAPI Logging logging
Benchmark information.
Definition: debug.cc:309
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
Definition: indent.cc:54
Definition: assertion.hh:24

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.