32 #ifndef HERMES_LOG_DEBUG_H
33 #define HERMES_LOG_DEBUG_H
45 #ifndef CHECKS_ENABLED
46 #define CHECKS_ENABLED
49 #ifndef ASSERTIONS_ENABLED
50 #define ASSERTIONS_ENABLED
59 #ifndef HERMES_UNUSED_VARIABLE
62 #define HERMES_UNUSED_VARIABLE(x) ((void)x);
65 #ifndef HERMES_NOT_IMPLEMENTED
67 #define HERMES_NOT_IMPLEMENTED \
68 printf("[%s][%d][%s] calling not implemented function.", __FILE__, __LINE__, __FUNCTION__);
74 #define HERMES_DEBUG_CODE(CODE_CONTENT) {CODE_CONTENT}
76 #define HERMES_DEBUG_CODE(CODE_CONTENT)
87 #define HERMES_CHECK_EQUAL(A, B) \
90 hermes::Log::warn("[{}][{}][CHECK_EQUAL FAIL {} == {}] {} != {}", __FILE__, __LINE__, (#A), (#B), A, B); \
95 #define HERMES_CHECK_EXP(expr) \
98 hermes::Log::warn("[{}][{}][CHECK_EXP FAIL {}]", __FILE__, __LINE__, (#expr)); \
104 #define HERMES_CHECK_EXP_WITH_LOG(expr, M) \
107 hermes::Log::warn("[{}][{}][CHECK_EXP FAIL {}]: {}", __FILE__, __LINE__, (#expr), M); \
111 #define HERMES_CHECK_EXP(expr)
112 #define HERMES_CHECK_EXP_WITH_LOG(expr, M)
118 #ifdef ASSERTIONS_ENABLED
121 #define debugBreak() exit(-1)
125 #define HERMES_ASSERT(expr) \
128 hermes::Log::error("[{}][{}][ASSERT FAIL {}]", __FILE__, __LINE__, #expr); \
134 #define HERMES_ASSERT_WITH_LOG(expr, M) \
137 hermes::Log::error("[{}][{}][ASSERT FAIL {}]: {}", __FILE__, __LINE__, #expr, M); \
142 #define HERMES_ASSERT(expr)
143 #define HERMES_ASSERT_WITH_LOG(expr, M)
151 #define HERMES_RETURN_IF(A) \
157 #define HERMES_RETURN_IF_NOT(A) \
164 #define HERMES_RETURN_VALUE_IF(A, R) \
171 #define HERMES_RETURN_VALUE_IF_NOT(A, R) \
179 #define HERMES_LOG_AND_RETURN_VALUE_IF_NOT(A, R, M) \
187 #define HERMES_LOG_AND_RETURN_IF_NOT(A, M) \