25#ifndef JPL_ERROR_REPORTING_DEFINED
26#define JPL_ERROR_REPORTING_DEFINED
31#include <source_location>
36#ifdef JPL_TAGGED_LOGGING
49#ifndef JPL_ENABLE_ASSERTS
50#define JPL_ENABLE_ASSERTS
52#if !defined (JPL_TEST) && !defined(JPL_ENABLE_ENSURE)
53#define JPL_ENABLE_ENSURE
57#if defined(JPL_ENABLE_ASSERTS) || defined(JPL_ENABLE_ENSURE)
74#ifdef JPL_ENABLE_ASSERTS
76#define JPL_ASSERT(inExpression, ...) do { if (!(inExpression) && ::JPL::AssertFailedParamHelper(#inExpression, std::source_location::current(), ##__VA_ARGS__)) JPL_BREAKPOINT; } while (false)
78#define JPL_IF_ENABLE_ASSERTS(...) __VA_ARGS__
80#define JPL_ASSERT(...) ((void)0)
82#define JPL_IF_ENABLE_ASSERTS(...)
88#ifdef JPL_ENABLE_ENSURE
90#define JPL_ENSURE(inExpression, ...) [&]{ if(!(inExpression) && ::JPL::AssertFailedParamHelper(#inExpression, std::source_location::current(), ##__VA_ARGS__)) { JPL_BREAKPOINT; } return (inExpression); }()
92#define JPL_ENSURE(inExpression, ...) (inExpression)
97 #ifdef JPL_TAGGED_LOGGING
98 #define JPL_TRACE_TAG(tag, message) JPLTraceTaggedTrace(tag, message)
100 #define JPL_TRACE_TAG(tag, message) SpatialTrace(std::format("[{}]: Trace: {}", tag, message).c_str())
105 #ifdef JPL_TAGGED_LOGGING
106 #define JPL_INFO_TAG(tag, message) JPLTraceTaggedInfo(tag, message)
108 #define JPL_INFO_TAG(tag, message) SpatialTrace(std::format("[{}]: Info: {}", tag, message).c_str())
113 #ifdef JPL_TAGGED_LOGGING
114 #define JPL_WARN_TAG(tag, message) JPLTraceTaggedWarn(tag, message)
116 #define JPL_WARN_TAG(tag, message) SpatialTrace(std::format("[{}]: Warning: {}", tag, message).c_str())
121 #ifdef JPL_TAGGED_LOGGING
122 #define JPL_ERROR_TAG(tag, message) JPLTraceTaggedError(tag, message)
124 #define JPL_ERROR_TAG(tag, message) SpatialTrace(std::format("[{}]: Error: {}", tag, message).c_str())
#define JPL_EXPORT
Definition Core.h:235
Definition AcousticMaterial.h:36
bool AssertFailedParamHelper(const char *inExpression, const std::source_location location)
Definition ErrorReporting.h:63
JPL_INLINE simd min(const simd &a, const simd &b) noexcept
Element-wise min.
Definition SIMD.h:1813
void(*)(const char *message) TraceFunction
Trace function, needs to be overridden by application. This should output a line of text to the log /...
Definition ErrorReporting.h:43
JPL_EXPORT TraceFunction SpatialTrace
bool(*)(const char *inExpression, const char *inMessage, const std::source_location) AssertFailedFunction
Function called when an assertion fails. This function should return true if a breakpoint needs to be...
Definition ErrorReporting.h:59
JPL_EXPORT AssertFailedFunction AssertFailed