utils/include/debug

Defines

FEASST_MACRO_EXCEPTION(message, name)

Throw exception.

ASSERT(condition, message)

If the assertion condition is not true, throw exception with message.

ERROR(message)

Throw exception with message.

FATAL(message)

Throw exception with message.

TRY(code)

Try block to expect an error. Disable if VERBOSE_LEVEL is 0.

CATCH_PHRASE(phrase)

Expect to catch exception with phrase in message.

FEASST_MACRO_OUTPUT(message, name, level)

Debug with message to standard output.

WARN(message)

Define and name the various levels of verbosity.

INFO(message)
DEBUG(message)
TRACE(message)
namespace feasst

Functions

std::string feasst_dir_trim_(const char *file_name)

Return file_name with FEASST_DIR_ path removed.

std::string feasst_omp_thread()
void feasst_macro_output(const std::string &name, std::string message)

Variables

constexpr int VERBOSE_LEVEL = FEASST_VERBOSE_LEVEL_

The verbosity level sets which error and debugging checks and messages are utilized.

The order of verbosity is as follows:

0. FATAL

  1. ERROR and ASSERT

  2. WARN

  3. INFO

  4. DEBUG

  5. TRACE

These macros will print if they are equal to or less than the verbosity level.

A way to decide whether to use TRACE or DEBUG is as follows. If the printout is once every trial move or less frequent, then DEBUG is acceptable. If the printout is more than once every trial (e.g., inside the visitor loop for a model) then use TRACE instead.

Set the VERBOSE_LEVEL during installation with: “cmake -DFEASST_VERBOSE_LEVEL=3 ..”