GEOS
Classes | Namespaces | Macros | Functions
Logger.hpp File Reference
#include "common/GeosxConfig.hpp"
#include "common/GeosxMacros.hpp"
#include "common/format/Format.hpp"
#include "LvArray/src/Macros.hpp"
#include "common/logger/ErrorHandling.hpp"
#include <stdexcept>

Go to the source code of this file.

Classes

struct  geos::InputError
 Exception class used to report errors in user input. More...
 
struct  geos::SimulationError
 Exception class used to report errors in user input. More...
 
struct  geos::BadTypeError
 Exception class used to report errors from type conversion. More...
 
class  geos::NotAnError
 Exception class used for special control flow. More...
 

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_ERROR_LOGGER_INSTANCE   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 845 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 862 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 855 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 913 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 906 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 896 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 889 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 947 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 940 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 930 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 923 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 814 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 879 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 872 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 826 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 222 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 213 of file Logger.hpp.

◆ GEOS_ERROR_IF_CAUSE

#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.

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 154 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 439 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 432 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 490 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 483 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 473 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 466 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 525 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 517 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 507 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 500 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 456 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 449 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 415 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 401 of file Logger.hpp.

◆ GEOS_ERROR_LOGGER_INSTANCE

#define GEOS_ERROR_LOGGER_INSTANCE   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 141 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 394 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 388 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 41 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 58 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 127 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 102 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 73 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 88 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 112 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 133 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 47 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 306 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 296 of file Logger.hpp.

◆ GEOS_THROW_IF_CAUSE

#define GEOS_THROW_IF_CAUSE (   COND,
  CAUSE_MESSAGE,
  MSG,
  ... 
)

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 234 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 688 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 678 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 751 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 741 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 730 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 720 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 793 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 783 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 772 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 762 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 709 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 699 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 659 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 381 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 372 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::string __message = __msgoss.str(); \
__msgoss = std::ostringstream(); \
__msgoss << CAUSE_MESSAGE; \
std::string __cause = __msgoss.str(); \
std::ostringstream __oss; \
__oss << "***** WARNING\n"; \
__oss << "***** LOCATION: " LOCATION "\n"; \
__oss << "***** " << __cause << "\n"; \
__oss << "***** Rank " << ::geos::logger::internal::g_rankString << ": " << __message << "\n"; \
std::cout << __oss.str() << std::endl; \
if( GEOS_ERROR_LOGGER_INSTANCE.isOutputFileEnabled() ) \
{ \
ErrorLogger::ErrorMsg msgStruct( ErrorLogger::MsgType::Warning, \
__message, \
::geos::logger::internal::g_rank, \
__FILE__, \
__LINE__ ); \
msgStruct.setCause( __cause ); \
msgStruct.addContextInfo( GEOS_DETAIL_REST_ARGS( __VA_ARGS__ ) ); \
GEOS_ERROR_LOGGER_INSTANCE.flushErrorMsg( msgStruct ); \
} \
} \
} while( false )
#define GEOS_DETAIL_FIRST_ARG(...)
#define GEOS_DETAIL_REST_ARGS(...)
#define GEOS_ERROR_LOGGER_INSTANCE
Error logger instance to use in GEOS_ERROR*, GEOS_ASSERT*, GEOS_THROW*, GEOS_WARNING* macros.
Definition: Logger.hpp:141
std::string string
String type.
Definition: DataTypes.hpp:90

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 317 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 561 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 554 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 612 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 605 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 595 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 588 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 646 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 639 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 629 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 622 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 578 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 571 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 537 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