HTGS  v2.0
The Hybrid Task Graph Scheduler
debug_message.hpp File Reference

Provides functionality for debug messaging. More...

#include <iosfwd>
#include <iostream>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  htgs_dbglog
 Debug logging structure for processing various types of arguments for std::cerr. More...
 

Macros

#define HTGS_ASSERT(condition, message)
 Prints a more meaningful assertion message and terminates if the condition fails. More...
 
#define HTGS_VERBOSE   1
 Defines verbose mode.
 
#define HTGS_DEBUG_MSG_LEVEL(msg, level)
 Prints a debug message to std::cerr with the specified level. More...
 
#define HTGS_DEBUG(msg)   HTGS_DEBUG_MSG_LEVEL(msg, 0)
 Prints a debug message to std::cerr with standard level If DEBUG_FLAG is not defined, this equates to a no op Each message includes the file and line number for where the debug is called. More...
 
#define HTGS_DEBUG_VERBOSE(msg)   HTGS_DEBUG_MSG_LEVEL(msg, HTGS_VERBOSE)
 Prints a debug message to std:cerr with VERBOSE level. More...
 
#define HTGS_DEBUG_LEVEL   0
 Defines the debug level for printing debug messages.
 
#define HTGS_DEBUG_ENABLED   0
 Defines whether debug is enabled or disabled.
 

Detailed Description

Provides functionality for debug messaging.

Author
Timothy Blattner
Date
Nov 16, 2015

Macro Definition Documentation

◆ HTGS_ASSERT

#define HTGS_ASSERT (   condition,
  message 
)
Value:
do { \
if (! (condition)) { \
std::cerr << message << ": Assertion `" #condition "` failed in " << __FILE__ \
<< ":" << __LINE__ << ": " << std::endl; \
std::terminate(); \
} \
} while (false)

Prints a more meaningful assertion message and terminates if the condition fails.

Parameters
conditionthe condition to check the message to output

◆ HTGS_DEBUG

#define HTGS_DEBUG (   msg)    HTGS_DEBUG_MSG_LEVEL(msg, 0)

Prints a debug message to std::cerr with standard level If DEBUG_FLAG is not defined, this equates to a no op Each message includes the file and line number for where the debug is called.

Parameters
msgthe message
Note
#define DEBUG_FLAG to enable debug messages

◆ HTGS_DEBUG_MSG_LEVEL

#define HTGS_DEBUG_MSG_LEVEL (   msg,
  level 
)
Value:
if (!HTGS_DEBUG_ENABLED || HTGS_DEBUG_LEVEL < level) {} \
else htgs_dbglog() << __FILE__ << ":" << __LINE__ << " " << msg
Debug logging structure for processing various types of arguments for std::cerr.
Definition: debug_message.hpp:100
#define HTGS_DEBUG_LEVEL
Defines the debug level for printing debug messages.
Definition: debug_message.hpp:84
#define HTGS_DEBUG_ENABLED
Defines whether debug is enabled or disabled.
Definition: debug_message.hpp:94

Prints a debug message to std::cerr with the specified level.

If the specified message level is greater than defined DEBUG_LEVEL or if DEBUG_FLAG is not defined, then this equates to a no op. Each message includes the file and line number for where the debug is called

Parameters
msgthe message
levelthe message level
Note
#define DEBUG_FLAG to enable debug messages

◆ HTGS_DEBUG_VERBOSE

#define HTGS_DEBUG_VERBOSE (   msg)    HTGS_DEBUG_MSG_LEVEL(msg, HTGS_VERBOSE)

Prints a debug message to std:cerr with VERBOSE level.

If DEBUG_FLAG is not defined or the DEBUG_LEVEL is not VERBOSE, then this equates to a no op Each message includes the file and line number for where the debug is called

Parameters
msgthe message
Note
#define DEBUG_FLAG to enable debug messages
#define DEBUG_LEVEL_VERBOSE to enable VERBOSE debugging