GEOS
Namespaces | Macros | Functions
Logger.hpp File Reference
#include "LvArray/src/Macros.hpp"
#include "common/logger/GeosExceptions.hpp"
#include <stdexcept>

Go to the source code of this file.

Namespaces

 geos
 

Macros

#define GEOS_LOG(...)   LVARRAY_LOG( __VA_ARGS__ )
 Log a message on screen. More...
 
#define GEOS_LOG_VAR(...)   LVARRAY_LOG_VAR( __VA_ARGS__ )
 Log an expression and its value on screen. More...
 
#define GEOS_LOG_IF(EXP, msg)
 Conditionally log a message. More...
 
#define GEOS_LOG_RANK_0_IF(EXP, msg)
 Conditionally log a message on screen on rank 0. More...
 
#define GEOS_LOG_RANK_0_IF_NLR(EXP, msg)
 Conditionally log a message on screen on rank 0 without line breaking. More...
 
#define GEOS_LOG_RANK_0(msg)   GEOS_LOG_RANK_0_IF( true, msg )
 Log a message on screen on rank 0. More...
 
#define GEOS_LOG_RANK_IF(EXP, msg)
 Conditionally log a message to the rank output stream. More...
 
#define GEOS_LOG_RANK(msg)   GEOS_LOG_RANK_IF( true, msg )
 Log a message to the rank output stream. More...
 
#define GEOS_LOG_RANK_VAR(var)   GEOS_LOG_RANK( #var " = " << var )
 Log a variable/expression name and value on screen to the rank output stream. More...
 
#define GEOS_GLOBAL_LOGGER   ErrorLogger::global()
 Error logger instance to use in GEOS_ERROR*, GEOS_ASSERT*, GEOS_THROW*, GEOS_WARNING* macros. More...
 
#define GEOS_ERROR_IF_CAUSE(COND, CAUSE_MESSAGE, ...)
 Conditionally raise a hard error and terminate the program. Implementation of GEOS_ERROR_* and GEOS_ASSERT_* macros. More...
 
#define GEOS_ERROR_IF(COND, ...)    GEOS_ERROR_IF_CAUSE( COND, "Error cause: " STRINGIZE( COND ), __VA_ARGS__ )
 Conditionally raise a hard error and terminate the program. More...
 
#define GEOS_ERROR(...)   GEOS_ERROR_IF_CAUSE( true, "", __VA_ARGS__ )
 Raise a hard error and terminate the program. More...
 
#define GEOS_THROW_IF_CAUSE(COND, CAUSE_MESSAGE, MSG, ...)
 Conditionally throw an exception. More...
 
#define GEOS_THROW_IF(COND, MSG, ...)    GEOS_THROW_IF_CAUSE( COND, "Error cause: " STRINGIZE( COND ), MSG, __VA_ARGS__ )
 Conditionally raise a hard error and terminate the program. More...
 
#define GEOS_THROW(MSG, ...)   GEOS_THROW_IF_CAUSE( true, "", MSG, __VA_ARGS__ )
 Conditionally raise a hard error and terminate the program. More...
 
#define GEOS_WARNING_IF_CAUSE(COND, CAUSE_MESSAGE, ...)
 Conditionally report a warning. More...
 
#define GEOS_WARNING_IF(COND, ...)    GEOS_WARNING_IF_CAUSE( COND, "Warning cause: " STRINGIZE( COND ), __VA_ARGS__ )
 Conditionally report a warning. More...
 
#define GEOS_WARNING(...)   GEOS_WARNING_IF_CAUSE( true, "", __VA_ARGS__ )
 Report a warning. More...
 
#define GEOS_INFO_IF(EXP, msg)   LVARRAY_INFO_IF( EXP, msg )
 Conditionally log an info message. More...
 
#define GEOS_INFO(msg)   LVARRAY_INFO( msg )
 Log an info message. More...
 
#define GEOS_ERROR_LHS_RHS_DECLS(lhs, rhs)
 Declares variables for "assertion" evaluation only on CPU; no-op on GPU to avoid device compilation errors. More...
 
#define GEOS_ERROR_IF_OP_MSG(lhs, OP, NOP, rhs, ...)
 Abort execution if lhs OP rhs. More...
 
#define GEOS_ERROR_IF_EQ_MSG(lhs, rhs, ...)   GEOS_ERROR_IF_OP_MSG( lhs, ==, !=, rhs, __VA_ARGS__ )
 Raise a hard error if two values are equal. More...
 
#define GEOS_ERROR_IF_EQ(lhs, rhs)   GEOS_ERROR_IF_EQ_MSG( lhs, rhs, "" )
 Raise a hard error if two values are equal. More...
 
#define GEOS_ERROR_IF_NE_MSG(lhs, rhs, ...)   GEOS_ERROR_IF_OP_MSG( lhs, !=, ==, rhs, __VA_ARGS__ )
 Raise a hard error if two values are not equal. More...
 
#define GEOS_ERROR_IF_NE(lhs, rhs)   GEOS_ERROR_IF_NE_MSG( lhs, rhs, "" )
 Raise a hard error if two values are not equal. More...
 
#define GEOS_ERROR_IF_GT_MSG(lhs, rhs, ...)   GEOS_ERROR_IF_OP_MSG( lhs, >, <=, rhs, __VA_ARGS__ )
 Raise a hard error if one value compares greater than the other. More...
 
#define GEOS_ERROR_IF_GT(lhs, rhs)   GEOS_ERROR_IF_GT_MSG( lhs, rhs, "" )
 Raise a hard error if one value compares greater than the other. More...
 
#define GEOS_ERROR_IF_GE_MSG(lhs, rhs, ...)   GEOS_ERROR_IF_OP_MSG( lhs, >=, <, rhs, __VA_ARGS__ )
 Raise a hard error if one value compares greater than or equal to the other. More...
 
#define GEOS_ERROR_IF_GE(lhs, rhs)   GEOS_ERROR_IF_GE_MSG( lhs, rhs, "" )
 Raise a hard error if one value compares greater than or equal to the other. More...
 
#define GEOS_ERROR_IF_LT_MSG(lhs, rhs, ...)   GEOS_ERROR_IF_OP_MSG( lhs, <, >=, rhs, __VA_ARGS__ )
 Raise a hard error if one value compares less than the other. More...
 
#define GEOS_ERROR_IF_LT(lhs, rhs)   GEOS_ERROR_IF_LT_MSG( lhs, rhs, "" )
 Raise a hard error if one value compares less than the other. More...
 
#define GEOS_ERROR_IF_LE_MSG(lhs, rhs, ...)   GEOS_ERROR_IF_OP_MSG( lhs, <=, >, rhs, __VA_ARGS__ )
 Raise a hard error if one value compares less than or equal to the other. More...
 
#define GEOS_ERROR_IF_LE(lhs, rhs)   GEOS_ERROR_IF_LE_MSG( lhs, rhs, "" )
 Raise a hard error if one value compares less than or equal to the other. More...
 
#define GEOS_WARNING_IF_OP_MSG(lhs, OP, NOP, rhs, ...)
 Log a warning if lhs OP rhs. More...
 
#define GEOS_WARNING_IF_EQ_MSG(lhs, rhs, ...)   GEOS_WARNING_IF_OP_MSG( lhs, ==, !=, rhs, __VA_ARGS__ )
 Log a warning if two values are equal. More...
 
#define GEOS_WARNING_IF_EQ(lhs, rhs)   GEOS_WARNING_IF_EQ_MSG( lhs, rhs, "" )
 Log a warning if two values are equal. More...
 
#define GEOS_WARNING_IF_NE_MSG(lhs, rhs, ...)   GEOS_WARNING_IF_OP_MSG( lhs, !=, ==, rhs, __VA_ARGS__ )
 Log a warning if two values are not equal. More...
 
#define GEOS_WARNING_IF_NE(lhs, rhs)   GEOS_WARNING_IF_NE_MSG( lhs, rhs, "" )
 Log a warning if two values are not equal. More...
 
#define GEOS_WARNING_IF_GT_MSG(lhs, rhs, ...)   GEOS_WARNING_IF_OP_MSG( lhs, >, <=, rhs, __VA_ARGS__ )
 Log a warning if one value compares greater than the other. More...
 
#define GEOS_WARNING_IF_GT(lhs, rhs)   GEOS_WARNING_IF_GT_MSG( lhs, rhs, "" )
 Log a warning if one value compares greater than the other. More...
 
#define GEOS_WARNING_IF_GE_MSG(lhs, rhs, ...)   GEOS_WARNING_IF_OP_MSG( lhs, >=, <, rhs, __VA_ARGS__ )
 Log a warning if one value compares greater than or equal to the other. More...
 
#define GEOS_WARNING_IF_GE(lhs, rhs)   GEOS_WARNING_IF_GE_MSG( lhs, rhs, "" )
 Log a warning if one value compares greater than or equal to the other. More...
 
#define GEOS_WARNING_IF_LT_MSG(lhs, rhs, ...)   GEOS_WARNING_IF_OP_MSG( lhs, <, >=, rhs, __VA_ARGS__ )
 Log a warning if one value compares less than the other. More...
 
#define GEOS_WARNING_IF_LT(lhs, rhs)   GEOS_WARNING_IF_LT_MSG( lhs, rhs, "" )
 Log a warning if one value compares less than the other. More...
 
#define GEOS_WARNING_IF_LE_MSG(lhs, rhs, ...)   GEOS_WARNING_IF_OP_MSG( lhs, <=, >, rhs, __VA_ARGS__ )
 Log a warning if one value compares less than or equal to the other. More...
 
#define GEOS_WARNING_IF_LE(lhs, rhs)   GEOS_WARNING_IF_LE_MSG( lhs, rhs, "" )
 Log a warning if one value compares less than or equal to the other. More...
 
#define GEOS_THROW_IF_OP_MSG(lhs, OP, NOP, rhs, MSG, ...)
 Throw an exception if lhs OP rhs. More...
 
#define GEOS_THROW_IF_EQ_MSG(lhs, rhs, MSG, ...)   GEOS_THROW_IF_OP_MSG( lhs, ==, !=, rhs, MSG, __VA_ARGS__ )
 Raise a hard error if two values are equal. More...
 
#define GEOS_THROW_IF_EQ(lhs, rhs, ...)   GEOS_THROW_IF_EQ_MSG( lhs, rhs, "", __VA_ARGS__ )
 Raise a hard error if two values are equal. More...
 
#define GEOS_THROW_IF_NE_MSG(lhs, rhs, MSG, ...)   GEOS_THROW_IF_OP_MSG( lhs, !=, ==, rhs, MSG, __VA_ARGS__ )
 Throw an exception if two values are not equal. More...
 
#define GEOS_THROW_IF_NE(lhs, rhs, ...)   GEOS_THROW_IF_NE_MSG( lhs, rhs, "", __VA_ARGS__ )
 Throw an exception if two values are not equal. More...
 
#define GEOS_THROW_IF_GT_MSG(lhs, rhs, MSG, ...)   GEOS_THROW_IF_OP_MSG( lhs, >, <=, rhs, MSG, __VA_ARGS__ )
 Throw an exception if one value compares greater than the other. More...
 
#define GEOS_THROW_IF_GT(lhs, rhs, ...)   GEOS_THROW_IF_GT_MSG( lhs, rhs, "", __VA_ARGS__ )
 Throw an exception if one value compares greater than the other. More...
 
#define GEOS_THROW_IF_GE_MSG(lhs, rhs, MSG, ...)   GEOS_THROW_IF_OP_MSG( lhs, >=, <, rhs, MSG, __VA_ARGS__ )
 Throw an exception if one value compares greater than or equal to the other. More...
 
#define GEOS_THROW_IF_GE(lhs, rhs, ...)   GEOS_THROW_IF_GE_MSG( lhs, rhs, "", __VA_ARGS__ )
 Throw an exception if one value compares greater than or equal to the other. More...
 
#define GEOS_THROW_IF_LT_MSG(lhs, rhs, MSG, ...)   GEOS_THROW_IF_OP_MSG( lhs, <, >=, rhs, MSG, __VA_ARGS__ )
 Throw an exception if one value compares less than the other. More...
 
#define GEOS_THROW_IF_LT(lhs, rhs, ...)   GEOS_THROW_IF_LT_MSG( lhs, rhs, "", __VA_ARGS__ )
 Throw an exception if one value compares less than the other. More...
 
#define GEOS_THROW_IF_LE_MSG(lhs, rhs, MSG, ...)   GEOS_THROW_IF_OP_MSG( lhs, <=, >, rhs, MSG, __VA_ARGS__ )
 Throw an exception if one value compares less than or equal to the other. More...
 
#define GEOS_THROW_IF_LE(lhs, rhs, ...)   GEOS_THROW_IF_LE_MSG( lhs, rhs, "", __VA_ARGS__ )
 Throw an exception if one value compares less than or equal to the other. More...
 
#define GEOS_ASSERT_ENABLED
 Enables assertion macros (GEOS_ASSERT*) when NDEBUG is not defined or previously explicitly enabled.
 
#define GEOS_ASSERT_MSG(COND, ...)    GEOS_ERROR_IF_CAUSE( !( COND ), "Expected: " STRINGIZE( COND ), __VA_ARGS__ )
 Abort execution if COND is false but only when NDEBUG is not defined.. More...
 
#define GEOS_ASSERT_OP_MSG(lhs, OP, rhs, ...)
 Abort execution if lhs OP rhs is false. More...
 
#define GEOS_ASSERT(COND)   GEOS_ASSERT_MSG( COND, "" )
 Assert a condition in debug builds. More...
 
#define GEOS_ASSERT_EQ_MSG(lhs, rhs, ...)   GEOS_ASSERT_OP_MSG( lhs, ==, rhs, __VA_ARGS__ )
 Assert that two values compare equal in debug builds. More...
 
#define GEOS_ASSERT_EQ(lhs, rhs)   GEOS_ASSERT_EQ_MSG( lhs, rhs, "" )
 Assert that two values compare equal in debug builds. More...
 
#define GEOS_ASSERT_NE_MSG(lhs, rhs, ...)   GEOS_ASSERT_OP_MSG( lhs, !=, rhs, __VA_ARGS__ )
 Assert that two values compare not equal in debug builds. More...
 
#define GEOS_ASSERT_NE(lhs, rhs)   GEOS_ASSERT_NE_MSG( lhs, rhs, "" )
 Assert that two values compare not equal in debug builds. More...
 
#define GEOS_ASSERT_GT_MSG(lhs, rhs, ...)   GEOS_ASSERT_OP_MSG( lhs, >, rhs, __VA_ARGS__ )
 Assert that one value compares greater than the other in debug builds. More...
 
#define GEOS_ASSERT_GT(lhs, rhs)   GEOS_ASSERT_GT_MSG( lhs, rhs, "" )
 Assert that one value compares greater than the other in debug builds. More...
 
#define GEOS_ASSERT_GE_MSG(lhs, rhs, ...)   GEOS_ASSERT_OP_MSG( lhs, >=, rhs, __VA_ARGS__ )
 Assert that one value compares greater than or equal to the other in debug builds. More...
 
#define GEOS_ASSERT_GE(lhs, rhs)   GEOS_ASSERT_GE_MSG( lhs, rhs, "" )
 Assert that one value compares greater than or equal to the other in debug builds. More...
 
#define GEOS_ASSERT_LT_MSG(lhs, rhs, ...)   GEOS_ASSERT_OP_MSG( lhs, <, rhs, __VA_ARGS__ )
 Assert that one value compares greater than the other in debug builds. More...
 
#define GEOS_ASSERT_LT(lhs, rhs)   GEOS_ASSERT_LT_MSG( lhs, rhs, "" )
 Assert that one value compares greater than the other in debug builds. More...
 
#define GEOS_ASSERT_LE_MSG(lhs, rhs, ...)   GEOS_ASSERT_OP_MSG( lhs, <=, rhs, __VA_ARGS__ )
 Assert that one value compares greater than or equal to the other in debug builds. More...
 
#define GEOS_ASSERT_LE(lhs, rhs)   GEOS_ASSERT_LE_MSG( lhs, rhs, "" )
 Assert that one value compares greater than or equal to the other in debug builds. More...
 

Functions

void geos::logger::InitializeLogger (const std::string &rank_output_dir="")
 Initialize the logger in a serial build. More...
 
void geos::logger::FinalizeLogger ()
 Finalize the logger and close the rank streams.
 

Macro Definition Documentation

◆ GEOS_ASSERT

#define GEOS_ASSERT (   COND)    GEOS_ASSERT_MSG( COND, "" )

Assert a condition in debug builds.

Parameters
CONDThe condition to check, causes an error if false.

Definition at line 868 of file Logger.hpp.

◆ GEOS_ASSERT_EQ

#define GEOS_ASSERT_EQ (   lhs,
  rhs 
)    GEOS_ASSERT_EQ_MSG( lhs, rhs, "" )

Assert that two values compare equal in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 885 of file Logger.hpp.

◆ GEOS_ASSERT_EQ_MSG

#define GEOS_ASSERT_EQ_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ASSERT_OP_MSG( lhs, ==, rhs, __VA_ARGS__ )

Assert that two values compare equal in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 878 of file Logger.hpp.

◆ GEOS_ASSERT_GE

#define GEOS_ASSERT_GE (   lhs,
  rhs 
)    GEOS_ASSERT_GE_MSG( lhs, rhs, "" )

Assert that one value compares greater than or equal to the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 936 of file Logger.hpp.

◆ GEOS_ASSERT_GE_MSG

#define GEOS_ASSERT_GE_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ASSERT_OP_MSG( lhs, >=, rhs, __VA_ARGS__ )

Assert that one value compares greater than or equal to the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 929 of file Logger.hpp.

◆ GEOS_ASSERT_GT

#define GEOS_ASSERT_GT (   lhs,
  rhs 
)    GEOS_ASSERT_GT_MSG( lhs, rhs, "" )

Assert that one value compares greater than the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 919 of file Logger.hpp.

◆ GEOS_ASSERT_GT_MSG

#define GEOS_ASSERT_GT_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ASSERT_OP_MSG( lhs, >, rhs, __VA_ARGS__ )

Assert that one value compares greater than the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 912 of file Logger.hpp.

◆ GEOS_ASSERT_LE

#define GEOS_ASSERT_LE (   lhs,
  rhs 
)    GEOS_ASSERT_LE_MSG( lhs, rhs, "" )

Assert that one value compares greater than or equal to the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 970 of file Logger.hpp.

◆ GEOS_ASSERT_LE_MSG

#define GEOS_ASSERT_LE_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ASSERT_OP_MSG( lhs, <=, rhs, __VA_ARGS__ )

Assert that one value compares greater than or equal to the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 963 of file Logger.hpp.

◆ GEOS_ASSERT_LT

#define GEOS_ASSERT_LT (   lhs,
  rhs 
)    GEOS_ASSERT_LT_MSG( lhs, rhs, "" )

Assert that one value compares greater than the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 953 of file Logger.hpp.

◆ GEOS_ASSERT_LT_MSG

#define GEOS_ASSERT_LT_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ASSERT_OP_MSG( lhs, <, rhs, __VA_ARGS__ )

Assert that one value compares greater than the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 946 of file Logger.hpp.

◆ GEOS_ASSERT_MSG

#define GEOS_ASSERT_MSG (   COND,
  ... 
)     GEOS_ERROR_IF_CAUSE( !( COND ), "Expected: " STRINGIZE( COND ), __VA_ARGS__ )

Abort execution if COND is false but only when NDEBUG is not defined..

Parameters
CONDThe condition to check, causes an error if false.
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)
Note
This macro can be used in both host and device code.
Tries to provide as much information about the location of the error as possible. On host this should result in the file and line of the error and a stack trace along with the provided message. On device none of this is guaranteed. In fact it is only guaranteed to abort the current kernel.

Definition at line 837 of file Logger.hpp.

◆ GEOS_ASSERT_NE

#define GEOS_ASSERT_NE (   lhs,
  rhs 
)    GEOS_ASSERT_NE_MSG( lhs, rhs, "" )

Assert that two values compare not equal in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 902 of file Logger.hpp.

◆ GEOS_ASSERT_NE_MSG

#define GEOS_ASSERT_NE_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ASSERT_OP_MSG( lhs, !=, rhs, __VA_ARGS__ )

Assert that two values compare not equal in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 895 of file Logger.hpp.

◆ GEOS_ASSERT_OP_MSG

#define GEOS_ASSERT_OP_MSG (   lhs,
  OP,
  rhs,
  ... 
)
Value:
{ \
GEOS_ERROR_LHS_RHS_DECLS( lhs, rhs ); \
GEOS_ERROR_IF_CAUSE( !( lhsResult OP rhsResult ), \
"Expected: " #lhs " " #OP " " #rhs "\n* " #lhs " = " << lhsResult << "\n* " #rhs " = " << rhsResult << "\n", \
__VA_ARGS__ ); \
}

Abort execution if lhs OP rhs is false.

Parameters
lhsThe left side of the operation.
OPThe operation to apply.
rhsThe right side of the operation.
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 849 of file Logger.hpp.

◆ GEOS_ERROR

#define GEOS_ERROR (   ...)    GEOS_ERROR_IF_CAUSE( true, "", __VA_ARGS__ )

Raise a hard error and terminate the program.

Parameters
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 226 of file Logger.hpp.

◆ GEOS_ERROR_IF

#define GEOS_ERROR_IF (   COND,
  ... 
)     GEOS_ERROR_IF_CAUSE( COND, "Error cause: " STRINGIZE( COND ), __VA_ARGS__ )

Conditionally raise a hard error and terminate the program.

Parameters
CONDA condition that causes the error if true.
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 217 of file Logger.hpp.

◆ GEOS_ERROR_IF_CAUSE

#define GEOS_ERROR_IF_CAUSE (   COND,
  CAUSE_MESSAGE,
  ... 
)
Value:
do \
{ \
if( COND ) \
{ \
std::ostringstream __msgoss; \
__msgoss << GEOS_DETAIL_FIRST_ARG( __VA_ARGS__ ); \
std::ostringstream __causemsgsoss; \
__causemsgsoss << CAUSE_MESSAGE; \
GEOS_GLOBAL_LOGGER.initCurrentExceptionMessage( MsgType::Error, __msgoss.str(), \
::geos::logger::internal::g_rank ) \
.setCodeLocation( __FILE__, __LINE__ ) \
.setCause( __causemsgsoss.str() ) \
.addCallStackInfo( LvArray::system::stackTrace( true ) ) \
.addContextInfo( GEOS_DETAIL_REST_ARGS( __VA_ARGS__ )); \
GEOS_GLOBAL_LOGGER.flushCurrentExceptionMessage(); \
LvArray::system::callErrorHandler(); \
} \
}while( false )
#define GEOS_DETAIL_FIRST_ARG(...)
#define GEOS_DETAIL_REST_ARGS(...)

Conditionally raise a hard error and terminate the program. Implementation of GEOS_ERROR_* and GEOS_ASSERT_* macros.

Parameters
CONDA condition that causes the error if true.
CAUSE_MESSAGEThe condition that caused the error, in a readable text format for the user.
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 151 of file Logger.hpp.

◆ GEOS_ERROR_IF_EQ

#define GEOS_ERROR_IF_EQ (   lhs,
  rhs 
)    GEOS_ERROR_IF_EQ_MSG( lhs, rhs, "" )

Raise a hard error if two values are equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 462 of file Logger.hpp.

◆ GEOS_ERROR_IF_EQ_MSG

#define GEOS_ERROR_IF_EQ_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ERROR_IF_OP_MSG( lhs, ==, !=, rhs, __VA_ARGS__ )

Raise a hard error if two values are equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 455 of file Logger.hpp.

◆ GEOS_ERROR_IF_GE

#define GEOS_ERROR_IF_GE (   lhs,
  rhs 
)    GEOS_ERROR_IF_GE_MSG( lhs, rhs, "" )

Raise a hard error if one value compares greater than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 513 of file Logger.hpp.

◆ GEOS_ERROR_IF_GE_MSG

#define GEOS_ERROR_IF_GE_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ERROR_IF_OP_MSG( lhs, >=, <, rhs, __VA_ARGS__ )

Raise a hard error if one value compares greater than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 506 of file Logger.hpp.

◆ GEOS_ERROR_IF_GT

#define GEOS_ERROR_IF_GT (   lhs,
  rhs 
)    GEOS_ERROR_IF_GT_MSG( lhs, rhs, "" )

Raise a hard error if one value compares greater than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 496 of file Logger.hpp.

◆ GEOS_ERROR_IF_GT_MSG

#define GEOS_ERROR_IF_GT_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ERROR_IF_OP_MSG( lhs, >, <=, rhs, __VA_ARGS__ )

Raise a hard error if one value compares greater than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 489 of file Logger.hpp.

◆ GEOS_ERROR_IF_LE

#define GEOS_ERROR_IF_LE (   lhs,
  rhs 
)    GEOS_ERROR_IF_LE_MSG( lhs, rhs, "" )

Raise a hard error if one value compares less than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 548 of file Logger.hpp.

◆ GEOS_ERROR_IF_LE_MSG

#define GEOS_ERROR_IF_LE_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ERROR_IF_OP_MSG( lhs, <=, >, rhs, __VA_ARGS__ )

Raise a hard error if one value compares less than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 540 of file Logger.hpp.

◆ GEOS_ERROR_IF_LT

#define GEOS_ERROR_IF_LT (   lhs,
  rhs 
)    GEOS_ERROR_IF_LT_MSG( lhs, rhs, "" )

Raise a hard error if one value compares less than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 530 of file Logger.hpp.

◆ GEOS_ERROR_IF_LT_MSG

#define GEOS_ERROR_IF_LT_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ERROR_IF_OP_MSG( lhs, <, >=, rhs, __VA_ARGS__ )

Raise a hard error if one value compares less than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 523 of file Logger.hpp.

◆ GEOS_ERROR_IF_NE

#define GEOS_ERROR_IF_NE (   lhs,
  rhs 
)    GEOS_ERROR_IF_NE_MSG( lhs, rhs, "" )

Raise a hard error if two values are not equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 479 of file Logger.hpp.

◆ GEOS_ERROR_IF_NE_MSG

#define GEOS_ERROR_IF_NE_MSG (   lhs,
  rhs,
  ... 
)    GEOS_ERROR_IF_OP_MSG( lhs, !=, ==, rhs, __VA_ARGS__ )

Raise a hard error if two values are not equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 472 of file Logger.hpp.

◆ GEOS_ERROR_IF_OP_MSG

#define GEOS_ERROR_IF_OP_MSG (   lhs,
  OP,
  NOP,
  rhs,
  ... 
)
Value:
do { \
GEOS_ERROR_LHS_RHS_DECLS( lhs, rhs ); \
GEOS_ERROR_IF_CAUSE( lhsResult OP rhsResult, \
"Expected: " #lhs " " #NOP " " #rhs "\n* " #lhs " = " << lhsResult << "\n* " #rhs " = " << rhsResult << "\n", \
__VA_ARGS__ ); \
} while(false)

Abort execution if lhs OP rhs.

Parameters
lhsThe left side of the operation.
OPThe operation to apply.
NOPThe operation that caused the error, used in the message (typically opposite of OP).
rhsThe right side of the operation.
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 438 of file Logger.hpp.

◆ GEOS_ERROR_LHS_RHS_DECLS

#define GEOS_ERROR_LHS_RHS_DECLS (   lhs,
  rhs 
)
Value:
GEOS_MAYBE_UNUSED auto const lhsResult = (lhs); \
GEOS_MAYBE_UNUSED auto const rhsResult = (rhs)
#define GEOS_MAYBE_UNUSED
[[maybe_unused]] when >= C++17, or compiler-specific implementations when < C++17

Declares variables for "assertion" evaluation only on CPU; no-op on GPU to avoid device compilation errors.

Parameters
lhsThe left side of the operation.
rhsThe right side of the operation.

Definition at line 424 of file Logger.hpp.

◆ GEOS_GLOBAL_LOGGER

#define GEOS_GLOBAL_LOGGER   ErrorLogger::global()

Error logger instance to use in GEOS_ERROR*, GEOS_ASSERT*, GEOS_THROW*, GEOS_WARNING* macros.

Note
- Currently not available on GPU.
  • Possible to pre-define it in any source file (e.g. for unit tests)

Definition at line 138 of file Logger.hpp.

◆ GEOS_INFO

#define GEOS_INFO (   msg)    LVARRAY_INFO( msg )

Log an info message.

Parameters
msga message to log (any expression that can be stream inserted)

Definition at line 417 of file Logger.hpp.

◆ GEOS_INFO_IF

#define GEOS_INFO_IF (   EXP,
  msg 
)    LVARRAY_INFO_IF( EXP, msg )

Conditionally log an info message.

Parameters
EXPan expression that will be evaluated as a predicate
msga message to log (any expression that can be stream inserted)

Definition at line 411 of file Logger.hpp.

◆ GEOS_LOG

#define GEOS_LOG (   ...)    LVARRAY_LOG( __VA_ARGS__ )

Log a message on screen.

The expression to log must evaluate something that can be stream inserted.

Definition at line 38 of file Logger.hpp.

◆ GEOS_LOG_IF

#define GEOS_LOG_IF (   EXP,
  msg 
)
Value:
do { \
if( EXP ) \
{ \
std::cout<< msg << std::endl; \
} \
} while( false )

Conditionally log a message.

Parameters
EXPan expression that will be evaluated as a predicate
msga message to log (any expression that can be stream inserted)

Definition at line 55 of file Logger.hpp.

◆ GEOS_LOG_RANK

#define GEOS_LOG_RANK (   msg)    GEOS_LOG_RANK_IF( true, msg )

Log a message to the rank output stream.

Parameters
msga message to log (any expression that can be stream inserted)

Definition at line 124 of file Logger.hpp.

◆ GEOS_LOG_RANK_0

#define GEOS_LOG_RANK_0 (   msg)    GEOS_LOG_RANK_0_IF( true, msg )

Log a message on screen on rank 0.

Parameters
msga message to log (any expression that can be stream inserted)

Definition at line 99 of file Logger.hpp.

◆ GEOS_LOG_RANK_0_IF

#define GEOS_LOG_RANK_0_IF (   EXP,
  msg 
)
Value:
do { \
if( ::geos::logger::internal::g_rank == 0 && EXP ) \
{ \
std::ostringstream oss; \
oss << msg; \
std::cout << oss.str() << std::endl; \
} \
} while( false )

Conditionally log a message on screen on rank 0.

Parameters
EXPan expression that will be evaluated as a predicate
msga message to log (any expression that can be stream inserted)

Definition at line 70 of file Logger.hpp.

◆ GEOS_LOG_RANK_0_IF_NLR

#define GEOS_LOG_RANK_0_IF_NLR (   EXP,
  msg 
)
Value:
do { \
if( ::geos::logger::internal::g_rank == 0 && EXP ) \
{ \
std::ostringstream oss; \
oss << msg; \
std::cout << oss.str(); \
} \
} while( false )

Conditionally log a message on screen on rank 0 without line breaking.

Parameters
EXPan expression that will be evaluated as a predicate
msga message to log (any expression that can be stream inserted)

Definition at line 85 of file Logger.hpp.

◆ GEOS_LOG_RANK_IF

#define GEOS_LOG_RANK_IF (   EXP,
  msg 
)
Value:
do { \
if( EXP ) \
{ \
std::ostringstream oss; \
oss << "Rank " << ::geos::logger::internal::g_rankString << ": " << msg; \
*logger::internal::g_rankStream << oss.str() << std::endl; \
} \
} while( false )

Conditionally log a message to the rank output stream.

Parameters
EXPan expression that will be evaluated as a predicate
msga message to log (any expression that can be stream inserted)

Definition at line 109 of file Logger.hpp.

◆ GEOS_LOG_RANK_VAR

#define GEOS_LOG_RANK_VAR (   var)    GEOS_LOG_RANK( #var " = " << var )

Log a variable/expression name and value on screen to the rank output stream.

Parameters
vara variable or expression accessible from current scope that can be stream inserted

Definition at line 130 of file Logger.hpp.

◆ GEOS_LOG_VAR

#define GEOS_LOG_VAR (   ...)    LVARRAY_LOG_VAR( __VA_ARGS__ )

Log an expression and its value on screen.

The expression to log must evaluate something that can be stream inserted.

Definition at line 44 of file Logger.hpp.

◆ GEOS_THROW

#define GEOS_THROW (   MSG,
  ... 
)    GEOS_THROW_IF_CAUSE( true, "", MSG, __VA_ARGS__ )

Conditionally raise a hard error and terminate the program.

Parameters
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 318 of file Logger.hpp.

◆ GEOS_THROW_IF

#define GEOS_THROW_IF (   COND,
  MSG,
  ... 
)     GEOS_THROW_IF_CAUSE( COND, "Error cause: " STRINGIZE( COND ), MSG, __VA_ARGS__ )

Conditionally raise a hard error and terminate the program.

Parameters
CONDA condition that causes the error if true.
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 308 of file Logger.hpp.

◆ GEOS_THROW_IF_CAUSE

#define GEOS_THROW_IF_CAUSE (   COND,
  CAUSE_MESSAGE,
  MSG,
  ... 
)
Value:
do \
{ \
if( COND ) \
{ \
std::ostringstream __msgoss; \
__msgoss << MSG; \
std::ostringstream __causemsgsoss; \
__causemsgsoss << CAUSE_MESSAGE; \
DiagnosticMsg exceptionMsg = GEOS_GLOBAL_LOGGER.initCurrentExceptionMessage( MsgType::Exception, __msgoss.str(), \
::geos::logger::internal::g_rank ) \
.setCodeLocation( __FILE__, __LINE__ ) \
.setCause( __causemsgsoss.str() ) \
.addCallStackInfo( LvArray::system::stackTrace( true ) ) \
.addContextInfo( GEOS_DETAIL_REST_ARGS( __VA_ARGS__ )) \
.getDiagnosticMsg(); \
auto ex = GEOS_DETAIL_FIRST_ARG( __VA_ARGS__ )(); \
ex.prepareWhat( exceptionMsg ); \
throw ex; \
} \
}while( false )
#define GEOS_GLOBAL_LOGGER
Error logger instance to use in GEOS_ERROR*, GEOS_ASSERT*, GEOS_THROW*, GEOS_WARNING* macros.
Definition: Logger.hpp:138

Conditionally throw an exception.

Parameters
CONDan expression that will be evaluated as a predicate
CAUSE_MESSAGEThe condition that caused the error, in a readable text format for the user.
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 238 of file Logger.hpp.

◆ GEOS_THROW_IF_EQ

#define GEOS_THROW_IF_EQ (   lhs,
  rhs,
  ... 
)    GEOS_THROW_IF_EQ_MSG( lhs, rhs, "", __VA_ARGS__ )

Raise a hard error if two values are equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 711 of file Logger.hpp.

◆ GEOS_THROW_IF_EQ_MSG

#define GEOS_THROW_IF_EQ_MSG (   lhs,
  rhs,
  MSG,
  ... 
)    GEOS_THROW_IF_OP_MSG( lhs, ==, !=, rhs, MSG, __VA_ARGS__ )

Raise a hard error if two values are equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 701 of file Logger.hpp.

◆ GEOS_THROW_IF_GE

#define GEOS_THROW_IF_GE (   lhs,
  rhs,
  ... 
)    GEOS_THROW_IF_GE_MSG( lhs, rhs, "", __VA_ARGS__ )

Throw an exception if one value compares greater than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 774 of file Logger.hpp.

◆ GEOS_THROW_IF_GE_MSG

#define GEOS_THROW_IF_GE_MSG (   lhs,
  rhs,
  MSG,
  ... 
)    GEOS_THROW_IF_OP_MSG( lhs, >=, <, rhs, MSG, __VA_ARGS__ )

Throw an exception if one value compares greater than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 764 of file Logger.hpp.

◆ GEOS_THROW_IF_GT

#define GEOS_THROW_IF_GT (   lhs,
  rhs,
  ... 
)    GEOS_THROW_IF_GT_MSG( lhs, rhs, "", __VA_ARGS__ )

Throw an exception if one value compares greater than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 753 of file Logger.hpp.

◆ GEOS_THROW_IF_GT_MSG

#define GEOS_THROW_IF_GT_MSG (   lhs,
  rhs,
  MSG,
  ... 
)    GEOS_THROW_IF_OP_MSG( lhs, >, <=, rhs, MSG, __VA_ARGS__ )

Throw an exception if one value compares greater than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 743 of file Logger.hpp.

◆ GEOS_THROW_IF_LE

#define GEOS_THROW_IF_LE (   lhs,
  rhs,
  ... 
)    GEOS_THROW_IF_LE_MSG( lhs, rhs, "", __VA_ARGS__ )

Throw an exception if one value compares less than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 816 of file Logger.hpp.

◆ GEOS_THROW_IF_LE_MSG

#define GEOS_THROW_IF_LE_MSG (   lhs,
  rhs,
  MSG,
  ... 
)    GEOS_THROW_IF_OP_MSG( lhs, <=, >, rhs, MSG, __VA_ARGS__ )

Throw an exception if one value compares less than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 806 of file Logger.hpp.

◆ GEOS_THROW_IF_LT

#define GEOS_THROW_IF_LT (   lhs,
  rhs,
  ... 
)    GEOS_THROW_IF_LT_MSG( lhs, rhs, "", __VA_ARGS__ )

Throw an exception if one value compares less than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 795 of file Logger.hpp.

◆ GEOS_THROW_IF_LT_MSG

#define GEOS_THROW_IF_LT_MSG (   lhs,
  rhs,
  MSG,
  ... 
)    GEOS_THROW_IF_OP_MSG( lhs, <, >=, rhs, MSG, __VA_ARGS__ )

Throw an exception if one value compares less than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 785 of file Logger.hpp.

◆ GEOS_THROW_IF_NE

#define GEOS_THROW_IF_NE (   lhs,
  rhs,
  ... 
)    GEOS_THROW_IF_NE_MSG( lhs, rhs, "", __VA_ARGS__ )

Throw an exception if two values are not equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 732 of file Logger.hpp.

◆ GEOS_THROW_IF_NE_MSG

#define GEOS_THROW_IF_NE_MSG (   lhs,
  rhs,
  MSG,
  ... 
)    GEOS_THROW_IF_OP_MSG( lhs, !=, ==, rhs, MSG, __VA_ARGS__ )

Throw an exception if two values are not equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 722 of file Logger.hpp.

◆ GEOS_THROW_IF_OP_MSG

#define GEOS_THROW_IF_OP_MSG (   lhs,
  OP,
  NOP,
  rhs,
  MSG,
  ... 
)
Value:
do { \
GEOS_ERROR_LHS_RHS_DECLS( lhs, rhs ); \
GEOS_THROW_IF_CAUSE( lhsResult OP rhsResult, \
"Expected: " #lhs " " #NOP " " #rhs "\n* " #lhs " = " << lhsResult << "\n* " #rhs " = " << rhsResult << "\n", \
MSG, __VA_ARGS__ ); \
} while(false)

Throw an exception if lhs OP rhs.

Parameters
lhsThe left side of the operation.
OPThe operation to apply.
NOPThe operation that caused the error, used in the message (typically opposite of OP).
rhsThe right side of the operation.
MSGa message to log (any expression that can be stream inserted)
...Variable arguments with the following structure:
  • Mandatory first parameter, the type of the exception to throw
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 682 of file Logger.hpp.

◆ GEOS_WARNING

#define GEOS_WARNING (   ...)    GEOS_WARNING_IF_CAUSE( true, "", __VA_ARGS__ )

Report a warning.

Parameters
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 404 of file Logger.hpp.

◆ GEOS_WARNING_IF

#define GEOS_WARNING_IF (   COND,
  ... 
)     GEOS_WARNING_IF_CAUSE( COND, "Warning cause: " STRINGIZE( COND ), __VA_ARGS__ )

Conditionally report a warning.

Parameters
CONDan expression that will be evaluated as a predicate
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 395 of file Logger.hpp.

◆ GEOS_WARNING_IF_CAUSE

#define GEOS_WARNING_IF_CAUSE (   COND,
  CAUSE_MESSAGE,
  ... 
)
Value:
do \
{ \
if( COND ) \
{ \
std::ostringstream __msgoss; \
__msgoss << GEOS_DETAIL_FIRST_ARG( __VA_ARGS__ ); \
std::ostringstream __causemsgsoss; \
__causemsgsoss << CAUSE_MESSAGE; \
DiagnosticMsg __warningMsg; \
GEOS_GLOBAL_LOGGER.flushErrorMsg( DiagnosticMsgBuilder::init( __warningMsg, \
MsgType::Warning, __msgoss.str(), \
::geos::logger::internal::g_rank ) \
.setCodeLocation( __FILE__, __LINE__ ) \
.setCause( __causemsgsoss.str() ) \
.addCallStackInfo( LvArray::system::stackTrace( true ) ) \
.addContextInfo( GEOS_DETAIL_REST_ARGS( __VA_ARGS__ )) \
.getDiagnosticMsg() ); \
} \
}while( false )

Conditionally report a warning.

Parameters
CONDA condition that causes the error if true.
CAUSE_MESSAGEThe condition that caused the error, in a readable text format for the user.
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 329 of file Logger.hpp.

◆ GEOS_WARNING_IF_EQ

#define GEOS_WARNING_IF_EQ (   lhs,
  rhs 
)    GEOS_WARNING_IF_EQ_MSG( lhs, rhs, "" )

Log a warning if two values are equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 584 of file Logger.hpp.

◆ GEOS_WARNING_IF_EQ_MSG

#define GEOS_WARNING_IF_EQ_MSG (   lhs,
  rhs,
  ... 
)    GEOS_WARNING_IF_OP_MSG( lhs, ==, !=, rhs, __VA_ARGS__ )

Log a warning if two values are equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 577 of file Logger.hpp.

◆ GEOS_WARNING_IF_GE

#define GEOS_WARNING_IF_GE (   lhs,
  rhs 
)    GEOS_WARNING_IF_GE_MSG( lhs, rhs, "" )

Log a warning if one value compares greater than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 635 of file Logger.hpp.

◆ GEOS_WARNING_IF_GE_MSG

#define GEOS_WARNING_IF_GE_MSG (   lhs,
  rhs,
  ... 
)    GEOS_WARNING_IF_OP_MSG( lhs, >=, <, rhs, __VA_ARGS__ )

Log a warning if one value compares greater than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 628 of file Logger.hpp.

◆ GEOS_WARNING_IF_GT

#define GEOS_WARNING_IF_GT (   lhs,
  rhs 
)    GEOS_WARNING_IF_GT_MSG( lhs, rhs, "" )

Log a warning if one value compares greater than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 618 of file Logger.hpp.

◆ GEOS_WARNING_IF_GT_MSG

#define GEOS_WARNING_IF_GT_MSG (   lhs,
  rhs,
  ... 
)    GEOS_WARNING_IF_OP_MSG( lhs, >, <=, rhs, __VA_ARGS__ )

Log a warning if one value compares greater than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 611 of file Logger.hpp.

◆ GEOS_WARNING_IF_LE

#define GEOS_WARNING_IF_LE (   lhs,
  rhs 
)    GEOS_WARNING_IF_LE_MSG( lhs, rhs, "" )

Log a warning if one value compares less than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 669 of file Logger.hpp.

◆ GEOS_WARNING_IF_LE_MSG

#define GEOS_WARNING_IF_LE_MSG (   lhs,
  rhs,
  ... 
)    GEOS_WARNING_IF_OP_MSG( lhs, <=, >, rhs, __VA_ARGS__ )

Log a warning if one value compares less than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 662 of file Logger.hpp.

◆ GEOS_WARNING_IF_LT

#define GEOS_WARNING_IF_LT (   lhs,
  rhs 
)    GEOS_WARNING_IF_LT_MSG( lhs, rhs, "" )

Log a warning if one value compares less than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 652 of file Logger.hpp.

◆ GEOS_WARNING_IF_LT_MSG

#define GEOS_WARNING_IF_LT_MSG (   lhs,
  rhs,
  ... 
)    GEOS_WARNING_IF_OP_MSG( lhs, <, >=, rhs, __VA_ARGS__ )

Log a warning if one value compares less than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 645 of file Logger.hpp.

◆ GEOS_WARNING_IF_NE

#define GEOS_WARNING_IF_NE (   lhs,
  rhs 
)    GEOS_WARNING_IF_NE_MSG( lhs, rhs, "" )

Log a warning if two values are not equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 601 of file Logger.hpp.

◆ GEOS_WARNING_IF_NE_MSG

#define GEOS_WARNING_IF_NE_MSG (   lhs,
  rhs,
  ... 
)    GEOS_WARNING_IF_OP_MSG( lhs, !=, ==, rhs, __VA_ARGS__ )

Log a warning if two values are not equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 594 of file Logger.hpp.

◆ GEOS_WARNING_IF_OP_MSG

#define GEOS_WARNING_IF_OP_MSG (   lhs,
  OP,
  NOP,
  rhs,
  ... 
)
Value:
do { \
GEOS_ERROR_LHS_RHS_DECLS( lhs, rhs ); \
GEOS_WARNING_IF_CAUSE( lhsResult OP rhsResult, \
"Expected: " #lhs " " #NOP " " #rhs "\n* " #lhs " = " << lhsResult << "\n* " #rhs " = " << rhsResult << "\n", \
__VA_ARGS__ ); \
} while(false)

Log a warning if lhs OP rhs.

Parameters
lhsThe left side of the operation.
OPThe operation to apply.
NOPThe operation that caused the error, used in the message (typically opposite of OP).
rhsThe right side of the operation.
...Variable arguments with the following structure:
  • Mandatory first parameter, the message to log (must be streamable)
  • Optional following parameters, context information on the current error (DataContext)

Definition at line 560 of file Logger.hpp.

Function Documentation

◆ InitializeLogger()

void geos::logger::InitializeLogger ( const std::string &  rank_output_dir = "")

Initialize the logger in a serial build.

Parameters
rank_output_diroutput directory for rank log files