AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
slic_macros.hpp File Reference
#include "axom/config.hpp"
#include "axom/core/Macros.hpp"

Classes

struct  axom::slic::detail::FalseType
 Variable of a type that evaluates as false. More...
 

Namespaces

 axom
 
 axom::slic
 
 axom::slic::detail
 

Macros

#define SLIC_INFO(msg)   SLIC_INFO_IF(true, msg)
 Logs an Info message. More...
 
#define SLIC_INFO_ONCE(msg)   SLIC_DETAIL_LOG_IF_ONCE(SLIC_INFO_IF, true, msg)
 Logs an Info message only once per call site. More...
 
#define SLIC_INFO_TAGGED(msg, tag)
 Logs an Info message to a tagged stream. More...
 
#define SLIC_INFO_TAGGED_ONCE(msg, tag)
 Logs an Info message to a tagged stream only once per call site. More...
 
#define SLIC_INFO_IF(EXP, msg)
 Logs an Info message iff EXP is true. More...
 
#define SLIC_INFO_IF_ONCE(EXP, msg)   SLIC_DETAIL_LOG_IF_ONCE(SLIC_INFO_IF, EXP, msg)
 Logs an Info message iff EXP is true, only once per call site. More...
 
#define SLIC_INFO_ROOT(msg)   SLIC_INFO_IF(axom::slic::isRoot(), msg)
 Logs an Info message if on root. More...
 
#define SLIC_INFO_ROOT_ONCE(msg)   SLIC_DETAIL_LOG_IF_ONCE(SLIC_INFO_IF, axom::slic::isRoot(), msg)
 Logs an Info message if on root, only once per call site. More...
 
#define SLIC_INFO_ROOT_IF(EXP, msg)   SLIC_INFO_IF((EXP) && (axom::slic::isRoot()), msg)
 Logs an Info message if on root and iff EXP is true. More...
 
#define SLIC_INFO_ROOT_IF_ONCE(EXP, msg)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_INFO_IF, (EXP) && (axom::slic::isRoot()), msg)
 Logs an Info message if on root and iff EXP is true, only once per call site. More...
 
#define SLIC_DEBUG(msg)   SLIC_DEBUG_IF(true, msg)
 Logs a Debug message. More...
 
#define SLIC_DEBUG_ONCE(msg)   SLIC_DETAIL_LOG_IF_ONCE(SLIC_DEBUG_IF, true, msg)
 Logs a Debug message only once per call site. More...
 
#define SLIC_DEBUG_IF(EXP, msg)
 Logs an Debug message iff EXP is true. More...
 
#define SLIC_DEBUG_IF_ONCE(EXP, msg)   SLIC_DETAIL_LOG_IF_ONCE(SLIC_DEBUG_IF, EXP, msg)
 Logs an Debug message iff EXP is true only once per call site. More...
 
#define SLIC_DEBUG_ROOT(msg)   SLIC_DEBUG_IF(axom::slic::isRoot(), msg)
 Logs a Debug message if on root. More...
 
#define SLIC_DEBUG_ROOT_ONCE(msg)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_DEBUG_IF, axom::slic::isRoot(), msg)
 Logs a Debug message if on root only once per call site. More...
 
#define SLIC_DEBUG_ROOT_IF(EXP, msg)   SLIC_DEBUG_IF((EXP) && (axom::slic::isRoot()), msg)
 Logs a Debug message if on root and iff EXP is true. More...
 
#define SLIC_DEBUG_ROOT_IF_ONCE(EXP, msg)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_DEBUG_IF, (EXP) && (axom::slic::isRoot()), msg)
 Logs a Debug message if on root and iff EXP is true, only once per call site. More...
 
#define SLIC_DEBUG_PRINT_CONTAINER(name, container)
 Logs a Debug message containing the contents of the container, moving the contents to the host if needed. More...
 
#define SLIC_DEBUG_PRINT_CONTAINER_ONCE(name, container)
 Logs a Debug message containing the contents of the container, moving the contents to the host if needed. Called only once per call site. More...
 
#define SLIC_DETAIL_LOG_IF_ONCE(macro, EXP, msg)
 Helper macro to define SLIC_*_ONCE macros that log only the first time they are used. More...
 
SLIC_ERROR MACROS
Attention
These error macros are collective operations. All ranks in the user-supplied communicator must call the macro when used within an MPI distributed environment, and slic::enableAbortOnError() is called for the current active logger (default is enabled for loggers)
See also
axom::slic::isAbortOnErrorsEnabled()
axom::slic::setAbortOnError(bool status)
#define SLIC_ERROR(msg)   SLIC_ERROR_IF(true, msg)
 Logs an error and aborts the application. More...
 
#define SLIC_ERROR_IF(EXP, msg)
 Logs an error iff EXP is true and aborts the application. More...
 
#define SLIC_ERROR_ROOT(msg)   SLIC_ERROR_IF(axom::slic::isRoot(), msg)
 Macro that logs given error message only on root. More...
 
#define SLIC_ERROR_ROOT_IF(EXP, msg)   SLIC_ERROR_IF((EXP) && (axom::slic::isRoot()), msg)
 Macro that logs given error message only on root iff EXP is true. More...
 
SLIC_WARNING MACROS
Attention
These warning macros can be set as collective operations. These warning macros are collective if slic::enableAbortOnWarning() is called for the current active logger (default is disabled for loggers). These warning macros must then be called by all ranks in the user-supplied communicator when used within an MPI distributed environment.
See also
axom::slic::isAbortOnWarningsEnabled()
axom::slic::setAbortOnWarning(bool status)
#define SLIC_WARNING(msg)   SLIC_WARNING_IF(true, msg)
 Logs a warning message. More...
 
#define SLIC_WARNING_ONCE(msg)   SLIC_DETAIL_LOG_IF_ONCE(SLIC_WARNING_IF, true, msg)
 Logs a warning message only once per call site. More...
 
#define SLIC_WARNING_IF(EXP, msg)
 Logs a warning iff EXP is true. More...
 
#define SLIC_WARNING_IF_ONCE(EXP, msg)   SLIC_DETAIL_LOG_IF_ONCE(SLIC_WARNING_IF, EXP, msg)
 Logs a warning iff EXP is true, and only once per call site. More...
 
#define SLIC_WARNING_ROOT(msg)   SLIC_WARNING_IF(axom::slic::isRoot(), msg)
 Macro that logs given warning message only on root. More...
 
#define SLIC_WARNING_ROOT_ONCE(msg)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_WARNING_IF, axom::slic::isRoot(), msg)
 Macro that logs given warning message only on root, and only once per call site. More...
 
#define SLIC_WARNING_ROOT_IF(EXP, msg)   SLIC_WARNING_IF((EXP) && (axom::slic::isRoot()), msg)
 Macro that logs given warning message only on root iff EXP is true. More...
 
#define SLIC_WARNING_ROOT_IF_ONCE(EXP, msg)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_WARNING_IF, (EXP) && (axom::slic::isRoot()), msg)
 Macro that logs given warning message only on root iff EXP is true, and only once per call site. More...
 
SLIC_ASSERT MACROS
Attention
These assert macros are collective operations. All ranks in the user-supplied communicator must call the macro when used within an MPI distributed environment, and slic::enableAbortOnError() is called for the current active logger (default is enabled for loggers)
See also
axom::slic::isAbortOnErrorsEnabled()
axom::slic::setAbortOnError(bool status)
#define SLIC_ASSERT(EXP)   SLIC_ASSERT_MSG(EXP, "")
 Asserts that a given expression is true. If the expression is not true an error will be logged and the application will be aborted. More...
 
#define SLIC_ASSERT_MSG(EXP, msg)
 Same as SLIC_ASSERT, but with a custom error message. More...
 
SLIC_CHECK MACROS
Attention
These check macros can be set as collective operations. These check macros are collective if either:
  • slic::debug::checksAreErrors is set to true (default is false) and slic::enableAbortOnError() is called for the current active logger (default is enabled for loggers)
  • slic::debug::checksAreErrors is set to false (default is false) and slic::enableAbortOnWarning() is called for the current active logger (default is disabled for loggers)

These check macros must then be called by all ranks in the user-supplied communicator when used within an MPI distributed environment.

See also
axom::slic::isAbortOnErrorsEnabled()
axom::slic::setAbortOnError(bool status)
axom::slic::isAbortOnWarningsEnabled()
axom::slic::setAbortOnWarning(bool status)
#define SLIC_CHECK(EXP)   SLIC_CHECK_MSG(EXP, "")
 Checks that a given expression is true. If the expression is not true a warning is logged, but, in contrast to the similar SLIC_ASSERT macro the application is not aborted. More...
 
#define SLIC_CHECK_MSG(EXP, msg)
 Same as SLIC_CHECK, but with a custom error message. More...
 

Variables

static const FalseType axom::slic::detail::false_value
 

Macro Definition Documentation

◆ SLIC_ERROR

#define SLIC_ERROR (   msg)    SLIC_ERROR_IF(true, msg)

Logs an error and aborts the application.

Parameters
[in]msguser-supplied message
Warning
This macro calls processAbort().
Note
The SLIC_ERROR macro is always active.

Usage:

SLIC_ERROR( "my_val should always be positive" );
#define SLIC_ERROR(msg)
Logs an error and aborts the application.
Definition: slic_macros.hpp:45

◆ SLIC_ERROR_IF

#define SLIC_ERROR_IF (   EXP,
  msg 
)
Value:
do \
{ \
if(EXP) \
{ \
std::ostringstream __oss; \
__oss << msg; \
axom::slic::logErrorMessage(__oss.str(), __FILE__, __LINE__); \
{ \
} \
} \
static const FalseType false_value
Definition: slic_macros.hpp:922
void abort()
Calls abort function. Default is abort() or MPI_Abort() in a MPI distributed environment.
bool isAbortOnErrorsEnabled()
Checks whether aborts on errors are enabled for the current logger.
void logErrorMessage(const std::string &message, const std::string &fileName, int line)
Convenience method to log an error message.

Logs an error iff EXP is true and aborts the application.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Warning
This macro calls processAbort() iff EXP is true.
Note
The SLIC_ERROR_IF macro is always active.

Usage:

SLIC_ERROR_IF( (val < 0), "my_val should always be positive" );
#define SLIC_ERROR_IF(EXP, msg)
Logs an error iff EXP is true and aborts the application.
Definition: slic_macros.hpp:63

◆ SLIC_ERROR_ROOT

#define SLIC_ERROR_ROOT (   msg)    SLIC_ERROR_IF(axom::slic::isRoot(), msg)

Macro that logs given error message only on root.

Parameters
[in]msguser-supplied message.
Warning
This macro calls processAbort() iff EXP is true.
Note
The SLIC_ERROR_ROOT macro is always active.
By default, all ranks are considered to be root. Must call axom::slic::initialize(is_root={true|false}) or set via axom::slic::setIsRoot({true|false}) to filter based on root.

Usage:

SLIC_ERROR_ROOT( "An error has occurred!" );
#define SLIC_ERROR_ROOT(msg)
Macro that logs given error message only on root.
Definition: slic_macros.hpp:96

◆ SLIC_ERROR_ROOT_IF

#define SLIC_ERROR_ROOT_IF (   EXP,
  msg 
)    SLIC_ERROR_IF((EXP) && (axom::slic::isRoot()), msg)

Macro that logs given error message only on root iff EXP is true.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_ERROR_ROOT_IF macro is always active.
By default, all ranks are considered to be root. Must call axom::slic::initialize(is_root={true|false}) or set via axom::slic::setIsRoot({true|false}) to filter based on root.

Usage:

SLIC_ERROR_ROOT_IF( (my_val < 0), "my_val should always be positive" );
#define SLIC_ERROR_ROOT_IF(EXP, msg)
Macro that logs given error message only on root iff EXP is true.
Definition: slic_macros.hpp:116

◆ SLIC_WARNING

#define SLIC_WARNING (   msg)    SLIC_WARNING_IF(true, msg)

Logs a warning message.

Parameters
[in]msguser-supplied message
Note
The SLIC_WARNING macro is always active.
Aborts the application when slic::enableAbortOnWarning()

Usage:

SLIC_WARNING( "my_val should always be positive" );
#define SLIC_WARNING(msg)
Logs a warning message.
Definition: slic_macros.hpp:151

◆ SLIC_WARNING_ONCE

#define SLIC_WARNING_ONCE (   msg)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_WARNING_IF, true, msg)

Logs a warning message only once per call site.

Parameters
[in]msguser-supplied message
Note
The SLIC_WARNING_ONCE macro is always active.
Aborts the application when slic::enableAbortOnWarning()

Usage:

SLIC_WARNING_ONCE( "my_val should always be positive" );
#define SLIC_WARNING_ONCE(msg)
Logs a warning message only once per call site.
Definition: slic_macros.hpp:168

◆ SLIC_WARNING_IF

#define SLIC_WARNING_IF (   EXP,
  msg 
)
Value:
do \
{ \
if(EXP) \
{ \
std::ostringstream __oss; \
__oss << msg; \
axom::slic::logWarningMessage(__oss.str(), __FILE__, __LINE__); \
{ \
} \
} \
bool isAbortOnWarningsEnabled()
Checks whether aborts on warnings are enabled for the current logger.
void logWarningMessage(const std::string &message, const std::string &fileName, int line)
Convenience method to log warning messages.

Logs a warning iff EXP is true.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_WARNING_IF macro is always active.
Aborts the application when slic::enableAbortOnWarning()

Usage:

SLIC_WARNING_IF( (val < 0), "my_val should always be positive" );
#define SLIC_WARNING_IF(EXP, msg)
Logs a warning iff EXP is true.
Definition: slic_macros.hpp:186

◆ SLIC_WARNING_IF_ONCE

#define SLIC_WARNING_IF_ONCE (   EXP,
  msg 
)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_WARNING_IF, EXP, msg)

Logs a warning iff EXP is true, and only once per call site.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_WARNING_IF_ONCE macro is always active.
Aborts the application when slic::enableAbortOnWarning()

Usage:

SLIC_WARNING_IF_ONCE( (val < 0), "my_val should always be positive" );
#define SLIC_WARNING_IF_ONCE(EXP, msg)
Logs a warning iff EXP is true, and only once per call site.
Definition: slic_macros.hpp:217

◆ SLIC_WARNING_ROOT

#define SLIC_WARNING_ROOT (   msg)    SLIC_WARNING_IF(axom::slic::isRoot(), msg)

Macro that logs given warning message only on root.

Parameters
[in]msguser-supplied message.
Note
The SLIC_WARNING_ROOT macro is always active.
By default, all ranks are considered to be root. Must call axom::slic::initialize(is_root={true|false}) or set via axom::slic::setIsRoot({true|false}) to filter based on root.

Usage:

SLIC_WARNING_ROOT( "A warning has occurred!" );
#define SLIC_WARNING_ROOT(msg)
Macro that logs given warning message only on root.
Definition: slic_macros.hpp:236

◆ SLIC_WARNING_ROOT_ONCE

#define SLIC_WARNING_ROOT_ONCE (   msg)     SLIC_DETAIL_LOG_IF_ONCE(SLIC_WARNING_IF, axom::slic::isRoot(), msg)

Macro that logs given warning message only on root, and only once per call site.

Parameters
[in]msguser-supplied message.
Note
The SLIC_WARNING_ROOT_ONCE macro is always active.
By default, all ranks are considered to be root. Must call axom::slic::initialize(is_root={true|false}) or set via axom::slic::setIsRoot({true|false}) to filter based on root.

Usage:

SLIC_WARNING_ROOT_ONCE( "A warning has occurred!" );
#define SLIC_WARNING_ROOT_ONCE(msg)
Macro that logs given warning message only on root, and only once per call site.
Definition: slic_macros.hpp:255

◆ SLIC_WARNING_ROOT_IF

#define SLIC_WARNING_ROOT_IF (   EXP,
  msg 
)    SLIC_WARNING_IF((EXP) && (axom::slic::isRoot()), msg)

Macro that logs given warning message only on root iff EXP is true.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_WARNING_ROOT_IF macro is always active.
By default, all ranks are considered to be root. Must call axom::slic::initialize(is_root={true|false}) or set via axom::slic::setIsRoot({true|false}) to filter based on root.

Usage:

SLIC_WARNING_ROOT_IF( (val < 0), "my_val should always be positive" );
#define SLIC_WARNING_ROOT_IF(EXP, msg)
Macro that logs given warning message only on root iff EXP is true.
Definition: slic_macros.hpp:276

◆ SLIC_WARNING_ROOT_IF_ONCE

#define SLIC_WARNING_ROOT_IF_ONCE (   EXP,
  msg 
)     SLIC_DETAIL_LOG_IF_ONCE(SLIC_WARNING_IF, (EXP) && (axom::slic::isRoot()), msg)

Macro that logs given warning message only on root iff EXP is true, and only once per call site.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_WARNING_ROOT_IF_ONCE macro is always active.
By default, all ranks are considered to be root. Must call axom::slic::initialize(is_root={true|false}) or set via axom::slic::setIsRoot({true|false}) to filter based on root.

Usage:

SLIC_WARNING_ROOT_IF_ONCE( (val < 0), "my_val should always be positive" );
#define SLIC_WARNING_ROOT_IF_ONCE(EXP, msg)
Macro that logs given warning message only on root iff EXP is true, and only once per call site.
Definition: slic_macros.hpp:297

◆ SLIC_ASSERT

#define SLIC_ASSERT (   EXP)    SLIC_ASSERT_MSG(EXP, "")

Asserts that a given expression is true. If the expression is not true an error will be logged and the application will be aborted.

Parameters
[in]EXPuser-supplied boolean expression.
Warning
This macro calls processAbort() iff EXP is false.
Note
This macro is only active when AXOM_DEBUG is defined.

Usage:

SLIC_ASSERT( my_val >= 0 );
#define SLIC_ASSERT(EXP)
Asserts that a given expression is true. If the expression is not true an error will be logged and th...
Definition: slic_macros.hpp:336

◆ SLIC_ASSERT_MSG

#define SLIC_ASSERT_MSG (   EXP,
  msg 
)
Value:
do \
{ \
if(!(EXP)) \
{ \
std::ostringstream __oss; \
__oss << "Failed Assert: " << #EXP << std::endl << msg; \
axom::slic::logErrorMessage(__oss.str(), __FILE__, __LINE__); \
{ \
} \
} \

Same as SLIC_ASSERT, but with a custom error message.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message
Warning
This macro calls processAbort() iff EXP is false.
Note
This macro is only active when AXOM_DEBUG is defined.
See also
SLIC_ASSERT( EXP )

Usage:

SLIC_ASSERT_MSG( my_val >= 0, "my_val must always be positive" );
#define SLIC_ASSERT_MSG(EXP, msg)
Same as SLIC_ASSERT, but with a custom error message.
Definition: slic_macros.hpp:355

◆ SLIC_CHECK

#define SLIC_CHECK (   EXP)    SLIC_CHECK_MSG(EXP, "")

Checks that a given expression is true. If the expression is not true a warning is logged, but, in contrast to the similar SLIC_ASSERT macro the application is not aborted.

Parameters
[in]EXPuser-supplied boolean expression.
Note
This macro is only active when AXOM_DEBUG is defined.

Usage:

SLIC_CHECK( my_val >= 0 );
#define SLIC_CHECK(EXP)
Checks that a given expression is true. If the expression is not true a warning is logged,...
Definition: slic_macros.hpp:411

◆ SLIC_CHECK_MSG

#define SLIC_CHECK_MSG (   EXP,
  msg 
)
Value:
do \
{ \
if(!(EXP)) \
{ \
std::ostringstream __oss; \
__oss << "Failed Check: " << #EXP << std::endl << msg; \
{ \
axom::slic::logErrorMessage(__oss.str(), __FILE__, __LINE__); \
{ \
} \
} \
else \
{ \
axom::slic::logWarningMessage(__oss.str(), __FILE__, __LINE__); \
{ \
} \
} \
} \
static AXOM_SLIC_EXPORT bool checksAreErrors
Definition: slic.hpp:34

Same as SLIC_CHECK, but with a custom error message.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message
Note
This macro is only active when AXOM_DEBUG is defined.
See also
SLIC_DEBUG( EXP )

Usage:

SLIC_CHECK_MSG( my_val >= 0, "my_val must always be positive" );
#define SLIC_CHECK_MSG(EXP, msg)
Same as SLIC_CHECK, but with a custom error message.
Definition: slic_macros.hpp:429

◆ SLIC_INFO

#define SLIC_INFO (   msg)    SLIC_INFO_IF(true, msg)

Logs an Info message.

Parameters
[in]msguser-supplied message
Note
The SLIC_INFO macro is always active.

Usage:

SLIC_INFO( "informative text goes here" );
#define SLIC_INFO(msg)
Logs an Info message.
Definition: slic_macros.hpp:489

◆ SLIC_INFO_ONCE

#define SLIC_INFO_ONCE (   msg)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_INFO_IF, true, msg)

Logs an Info message only once per call site.

Parameters
[in]msguser-supplied message
Note
The SLIC_INFO_ONCE macro is always active.

Usage:

SLIC_INFO_ONCE( "informative text goes here" );
#define SLIC_INFO_ONCE(msg)
Logs an Info message only once per call site.
Definition: slic_macros.hpp:505

◆ SLIC_INFO_TAGGED

#define SLIC_INFO_TAGGED (   msg,
  tag 
)
Value:
do \
{ \
std::ostringstream __oss; \
__oss << msg; \
axom::slic::logMessage(axom::slic::message::Info, __oss.str(), tag, __FILE__, __LINE__, false, true); \
@ Info
INFO log information that is useful for users & developers.
Definition: MessageLevel.hpp:37
void logMessage(message::Level level, const std::string &message, bool filter_duplicates=false)
Logs the given message to all registered streams.

Logs an Info message to a tagged stream.

Parameters
[in]msguser-supplied message
[in]taguser-supplied tag
Note
The SLIC_INFO_TAGGED macro is always active.

Usage:

SLIC_INFO_TAGGED("informative text goes here", "tag");
#define SLIC_INFO_TAGGED(msg, tag)
Logs an Info message to a tagged stream.
Definition: slic_macros.hpp:522

◆ SLIC_INFO_TAGGED_ONCE

#define SLIC_INFO_TAGGED_ONCE (   msg,
  tag 
)
Value:
do \
{ \
static bool once = true; \
if(once) \
{ \
SLIC_INFO_TAGGED(msg, tag); \
once = false; \
} \

Logs an Info message to a tagged stream only once per call site.

Parameters
[in]msguser-supplied message
[in]taguser-supplied tag
Note
The SLIC_INFO_TAGGED_ONCE macro is always active.

Usage:

SLIC_INFO_TAGGED_ONCE("informative text goes here", "tag");
#define SLIC_INFO_TAGGED_ONCE(msg, tag)
Logs an Info message to a tagged stream only once per call site.
Definition: slic_macros.hpp:545

◆ SLIC_INFO_IF

#define SLIC_INFO_IF (   EXP,
  msg 
)
Value:
do \
{ \
if(EXP) \
{ \
std::ostringstream __oss; \
__oss << msg; \
axom::slic::logMessage(axom::slic::message::Info, __oss.str(), __FILE__, __LINE__); \
} \

Logs an Info message iff EXP is true.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_INFO_IF macro is always active.

Usage:

SLIC_INFO_IF( (val < 0), "my_val should always be positive" );
#define SLIC_INFO_IF(EXP, msg)
Logs an Info message iff EXP is true.
Definition: slic_macros.hpp:571

◆ SLIC_INFO_IF_ONCE

#define SLIC_INFO_IF_ONCE (   EXP,
  msg 
)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_INFO_IF, EXP, msg)

Logs an Info message iff EXP is true, only once per call site.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_INFO_IF_ONCE macro is always active.

Usage:

SLIC_INFO_IF_ONCE( (val < 0), "my_val should always be positive" );
#define SLIC_INFO_IF_ONCE(EXP, msg)
Logs an Info message iff EXP is true, only once per call site.
Definition: slic_macros.hpp:597

◆ SLIC_INFO_ROOT

#define SLIC_INFO_ROOT (   msg)    SLIC_INFO_IF(axom::slic::isRoot(), msg)

Logs an Info message if on root.

Parameters
[in]msguser-supplied message.
Note
The SLIC_INFO_ROOT macro is always active.

Usage:

SLIC_INFO_ROOT( "informative text goes here" );
#define SLIC_INFO_ROOT(msg)
Logs an Info message if on root.
Definition: slic_macros.hpp:613

◆ SLIC_INFO_ROOT_ONCE

#define SLIC_INFO_ROOT_ONCE (   msg)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_INFO_IF, axom::slic::isRoot(), msg)

Logs an Info message if on root, only once per call site.

Parameters
[in]msguser-supplied message.
Note
The SLIC_INFO_ROOT_ONCE macro is always active.

Usage:

SLIC_INFO_ROOT_ONCE( "informative text goes here" );
#define SLIC_INFO_ROOT_ONCE(msg)
Logs an Info message if on root, only once per call site.
Definition: slic_macros.hpp:629

◆ SLIC_INFO_ROOT_IF

#define SLIC_INFO_ROOT_IF (   EXP,
  msg 
)    SLIC_INFO_IF((EXP) && (axom::slic::isRoot()), msg)

Logs an Info message if on root and iff EXP is true.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_INFO_ROOT_IF macro is always active.

Usage:

SLIC_INFO_ROOT_IF( (val < 0), "my_val should always be positive" );
#define SLIC_INFO_ROOT_IF(EXP, msg)
Logs an Info message if on root and iff EXP is true.
Definition: slic_macros.hpp:646

◆ SLIC_INFO_ROOT_IF_ONCE

#define SLIC_INFO_ROOT_IF_ONCE (   EXP,
  msg 
)     SLIC_DETAIL_LOG_IF_ONCE(SLIC_INFO_IF, (EXP) && (axom::slic::isRoot()), msg)

Logs an Info message if on root and iff EXP is true, only once per call site.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_INFO_ROOT_IF_ONCE macro is always active.

Usage:

SLIC_INFO_ROOT_IF_ONCE( (val < 0), "my_val should always be positive" );
#define SLIC_INFO_ROOT_IF_ONCE(EXP, msg)
Logs an Info message if on root and iff EXP is true, only once per call site.
Definition: slic_macros.hpp:663

◆ SLIC_DEBUG

#define SLIC_DEBUG (   msg)    SLIC_DEBUG_IF(true, msg)

Logs a Debug message.

Parameters
[in]msguser-supplied message
Note
The SLIC_Debug macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG( "debug message goes here" );
#define SLIC_DEBUG(msg)
Logs a Debug message.
Definition: slic_macros.hpp:682

◆ SLIC_DEBUG_ONCE

#define SLIC_DEBUG_ONCE (   msg)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_DEBUG_IF, true, msg)

Logs a Debug message only once per call site.

Parameters
[in]msguser-supplied message
Note
The SLIC_DEBUG_ONCE macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG_ONCE( "debug message goes here" );
#define SLIC_DEBUG_ONCE(msg)
Logs a Debug message only once per call site.
Definition: slic_macros.hpp:698

◆ SLIC_DEBUG_IF

#define SLIC_DEBUG_IF (   EXP,
  msg 
)
Value:
do \
{ \
if(EXP) \
{ \
std::ostringstream __oss; \
__oss << msg; \
axom::slic::logMessage(axom::slic::message::Debug, __oss.str(), __FILE__, __LINE__); \
} \
@ Debug
DEBUG log information that is useful for developers.
Definition: MessageLevel.hpp:38

Logs an Debug message iff EXP is true.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_DEBUG_IF macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG_IF( (val < 0), "my_val should always be positive" );
#define SLIC_DEBUG_IF(EXP, msg)
Logs an Debug message iff EXP is true.
Definition: slic_macros.hpp:715

◆ SLIC_DEBUG_IF_ONCE

#define SLIC_DEBUG_IF_ONCE (   EXP,
  msg 
)    SLIC_DETAIL_LOG_IF_ONCE(SLIC_DEBUG_IF, EXP, msg)

Logs an Debug message iff EXP is true only once per call site.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_DEBUG_IF_ONCE macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG_IF_ONCE( (val < 0), "my_val should always be positive" );
#define SLIC_DEBUG_IF_ONCE(EXP, msg)
Logs an Debug message iff EXP is true only once per call site.
Definition: slic_macros.hpp:741

◆ SLIC_DEBUG_ROOT

#define SLIC_DEBUG_ROOT (   msg)    SLIC_DEBUG_IF(axom::slic::isRoot(), msg)

Logs a Debug message if on root.

Parameters
[in]msguser-supplied message.
Note
The SLIC_DEBUG_ROOT macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG_ROOT( "informative text goes here" );
#define SLIC_DEBUG_ROOT(msg)
Logs a Debug message if on root.
Definition: slic_macros.hpp:757

◆ SLIC_DEBUG_ROOT_ONCE

#define SLIC_DEBUG_ROOT_ONCE (   msg)     SLIC_DETAIL_LOG_IF_ONCE(SLIC_DEBUG_IF, axom::slic::isRoot(), msg)

Logs a Debug message if on root only once per call site.

Parameters
[in]msguser-supplied message.
Note
The SLIC_DEBUG_ROOT_ONCE macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG_ROOT_ONCE( "informative text goes here" );
#define SLIC_DEBUG_ROOT_ONCE(msg)
Logs a Debug message if on root only once per call site.
Definition: slic_macros.hpp:773

◆ SLIC_DEBUG_ROOT_IF

#define SLIC_DEBUG_ROOT_IF (   EXP,
  msg 
)    SLIC_DEBUG_IF((EXP) && (axom::slic::isRoot()), msg)

Logs a Debug message if on root and iff EXP is true.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_DEBUG_ROOT_IF macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG_ROOT_IF( (val < 0), "my_val should always be positive" );
#define SLIC_DEBUG_ROOT_IF(EXP, msg)
Logs a Debug message if on root and iff EXP is true.
Definition: slic_macros.hpp:791

◆ SLIC_DEBUG_ROOT_IF_ONCE

#define SLIC_DEBUG_ROOT_IF_ONCE (   EXP,
  msg 
)     SLIC_DETAIL_LOG_IF_ONCE(SLIC_DEBUG_IF, (EXP) && (axom::slic::isRoot()), msg)

Logs a Debug message if on root and iff EXP is true, only once per call site.

Parameters
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.
Note
The SLIC_DEBUG_ROOT_IF_ONCE macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG_ROOT_IF_ONCE( (val < 0), "my_val should always be positive" );
#define SLIC_DEBUG_ROOT_IF_ONCE(EXP, msg)
Logs a Debug message if on root and iff EXP is true, only once per call site.
Definition: slic_macros.hpp:808

◆ SLIC_DEBUG_PRINT_CONTAINER

#define SLIC_DEBUG_PRINT_CONTAINER (   name,
  container 
)
Value:
do \
{ \
std::ostringstream __oss; \
axom::slic::detail::printContainer(__oss, name, container); \
axom::slic::logMessage(axom::slic::message::Debug, __oss.str(), __FILE__, __LINE__); \
void printContainer(std::ostream &os, const std::string &name, const ContainerType &container)
Print a container to a stream, moving the data to the host, if needed.
Definition: slic.hpp:539

Logs a Debug message containing the contents of the container, moving the contents to the host if needed.

Parameters
[in]nameThe name of the container in the printed message.
[in]containerThe container (array, vector, view).
Note
The SLIC_DEBUG_PRINT_CONTAINER macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG_PRINT_CONTAINER( "dataView", dataView );
Provides a view over a generic array container.
Definition: ArrayView.hpp:47
#define SLIC_DEBUG_PRINT_CONTAINER(name, container)
Logs a Debug message containing the contents of the container, moving the contents to the host if nee...
Definition: slic_macros.hpp:828

◆ SLIC_DEBUG_PRINT_CONTAINER_ONCE

#define SLIC_DEBUG_PRINT_CONTAINER_ONCE (   name,
  container 
)
Value:
do \
{ \
static bool once = true; \
if(once) \
{ \
SLIC_DEBUG_PRINT_CONTAINER(name, container); \
once = false; \
} \

Logs a Debug message containing the contents of the container, moving the contents to the host if needed. Called only once per call site.

Parameters
[in]nameThe name of the container in the printed message.
[in]containerThe container (array, vector, view).
Note
The SLIC_DEBUG_PRINT_CONTAINER_ONCE macro is active when AXOM_DEBUG is defined.

Usage:

SLIC_DEBUG_PRINT_CONTAINER_ONCE( "dataView", dataView );
#define SLIC_DEBUG_PRINT_CONTAINER_ONCE(name, container)
Logs a Debug message containing the contents of the container, moving the contents to the host if nee...
Definition: slic_macros.hpp:853

◆ SLIC_DETAIL_LOG_IF_ONCE

#define SLIC_DETAIL_LOG_IF_ONCE (   macro,
  EXP,
  msg 
)
Value:
do \
{ \
static bool once = true; \
if(EXP) \
{ \
if(once) \
{ \
macro(true, msg); \
once = false; \
} \
} \

Helper macro to define SLIC_*_ONCE macros that log only the first time they are used.

Parameters
[in]macrothe macro to call.
[in]EXPuser-supplied boolean expression.
[in]msguser-supplied message.