preCICE v3.1.2
Loading...
Searching...
No Matches
Macros
LogMacros.hpp File Reference
#include "utils/fmt.hpp"
#include "logging/Tracer.hpp"
#include "utils/ArgumentFormatter.hpp"
Include dependency graph for LogMacros.hpp:

Go to the source code of this file.

Macros

#define PRECICE_LOG_LOCATION
 
#define PRECICE_WARN(...)   _log.warning(PRECICE_LOG_LOCATION, precice::utils::format_or_error(__VA_ARGS__))
 
#define PRECICE_INFO(...)   _log.info(PRECICE_LOG_LOCATION, precice::utils::format_or_error(__VA_ARGS__))
 
#define PRECICE_ERROR(...)
 
#define PRECICE_WARN_IF(condition, ...)
 
#define PRECICE_INFO_IF(condition, ...)
 
#define PRECICE_CHECK(check, ...)
 
#define PRECICE_DEBUG(...)   _log.debug(PRECICE_LOG_LOCATION, precice::utils::format_or_error(__VA_ARGS__))
 
#define PRECICE_DEBUG_IF(condition, ...)
 
#define PRECICE_TRACE(...)
 

Macro Definition Documentation

◆ PRECICE_CHECK

#define PRECICE_CHECK ( check,
... )
Value:
do { \
if (!(check)) { \
PRECICE_ERROR(__VA_ARGS__); \
} \
} while (false)

Definition at line 35 of file LogMacros.hpp.

◆ PRECICE_DEBUG

#define PRECICE_DEBUG ( ...)    _log.debug(PRECICE_LOG_LOCATION, precice::utils::format_or_error(__VA_ARGS__))

Definition at line 64 of file LogMacros.hpp.

◆ PRECICE_DEBUG_IF

#define PRECICE_DEBUG_IF ( condition,
... )
Value:
do { \
if (condition) { \
PRECICE_DEBUG(__VA_ARGS__); \
} \
} while (false)

Definition at line 66 of file LogMacros.hpp.

◆ PRECICE_ERROR

#define PRECICE_ERROR ( ...)
Value:
do { \
std::exit(-1); \
} while (false)
#define PRECICE_LOG_LOCATION
Definition LogMacros.hpp:5
void error(LogLocation loc, std::string_view mess) noexcept
Definition Logger.cpp:157
std::string format_or_error(std::string_view str)
Definition fmt.hpp:19
static precice::logging::Logger _log("precicec")

Definition at line 15 of file LogMacros.hpp.

◆ PRECICE_INFO

#define PRECICE_INFO ( ...)    _log.info(PRECICE_LOG_LOCATION, precice::utils::format_or_error(__VA_ARGS__))

Definition at line 13 of file LogMacros.hpp.

◆ PRECICE_INFO_IF

#define PRECICE_INFO_IF ( condition,
... )
Value:
do { \
if (condition) { \
PRECICE_INFO(__VA_ARGS__); \
} \
} while (false)

Definition at line 28 of file LogMacros.hpp.

◆ PRECICE_LOG_LOCATION

#define PRECICE_LOG_LOCATION
Value:
{ \
__FILE__, __LINE__, __func__ \
}
Struct used to capture the original location of a log request.
Definition Logger.hpp:9

Definition at line 5 of file LogMacros.hpp.

◆ PRECICE_TRACE

#define PRECICE_TRACE ( ...)
Value:
_log.trace(PRECICE_LOG_LOCATION, std::string{"Entering "} + __func__ + PRECICE_LOG_ARGUMENTS(__VA_ARGS__))
#define PRECICE_LOG_ARGUMENTS(...)
void trace(LogLocation loc, std::string_view mess) noexcept
Definition Logger.cpp:189

Definition at line 95 of file LogMacros.hpp.

◆ PRECICE_WARN

#define PRECICE_WARN ( ...)    _log.warning(PRECICE_LOG_LOCATION, precice::utils::format_or_error(__VA_ARGS__))

Definition at line 11 of file LogMacros.hpp.

◆ PRECICE_WARN_IF

#define PRECICE_WARN_IF ( condition,
... )
Value:
do { \
if (condition) { \
PRECICE_WARN(__VA_ARGS__); \
} \
} while (false)

Definition at line 21 of file LogMacros.hpp.