mdbx: add auxiliary debug-begin/debug-end includes.

Change-Id: I9fad95e7e73a581c49388da31895aed94a3abbe4
This commit is contained in:
Leonid Yuriev 2019-11-13 03:20:25 +03:00
parent d3e4a4659f
commit b95fb5b124
3 changed files with 41 additions and 6 deletions

View File

@ -0,0 +1,34 @@
#pragma push_macro("mdbx_trace")
#pragma push_macro("mdbx_debug")
#pragma push_macro("mdbx_verbose")
#pragma push_macro("mdbx_notice")
#pragma push_macro("mdbx_warning")
#pragma push_macro("mdbx_error")
#pragma push_macro("mdbx_assert")
#undef mdbx_trace
#define mdbx_trace(fmt, ...) \
mdbx_debug_log(MDBX_LOG_TRACE, __func__, __LINE__, fmt "\n", __VA_ARGS__)
#undef mdbx_debug
#define mdbx_debug(fmt, ...) \
mdbx_debug_log(MDBX_LOG_DEBUG, __func__, __LINE__, fmt "\n", __VA_ARGS__)
#undef mdbx_verbose
#define mdbx_verbose(fmt, ...) \
mdbx_debug_log(MDBX_LOG_VERBOSE, __func__, __LINE__, fmt "\n", __VA_ARGS__)
#undef mdbx_notice
#define mdbx_notice(fmt, ...) \
mdbx_debug_log(MDBX_LOG_NOTICE, __func__, __LINE__, fmt "\n", __VA_ARGS__)
#undef mdbx_warning
#define mdbx_warning(fmt, ...) \
mdbx_debug_log(MDBX_LOG_WARN, __func__, __LINE__, fmt "\n", __VA_ARGS__)
#undef mdbx_error
#define mdbx_error(fmt, ...) \
mdbx_debug_log(MDBX_LOG_ERROR, __func__, __LINE__, fmt "\n", __VA_ARGS__)
#undef mdbx_assert
#define mdbx_assert(env, expr) mdbx_ensure(env, expr)

7
src/elements/debug_end.h Normal file
View File

@ -0,0 +1,7 @@
#pragma pop_macro("mdbx_trace")
#pragma pop_macro("mdbx_debug")
#pragma pop_macro("mdbx_verbose")
#pragma pop_macro("mdbx_notice")
#pragma pop_macro("mdbx_warning")
#pragma pop_macro("mdbx_error")
#pragma pop_macro("mdbx_assert")

View File

@ -1080,12 +1080,6 @@ MDBX_INTERNAL_FUNC void mdbx_assert_fail(const MDBX_env *env, const char *msg,
__VA_ARGS__); \
} while (0)
#define mdbx_debug_print(fmt, ...) \
do { \
if (mdbx_log_enabled(MDBX_LOG_DEBUG)) \
mdbx_debug_log(MDBX_LOG_DEBUG, NULL, 0, fmt, __VA_ARGS__); \
} while (0)
#define mdbx_verbose(fmt, ...) \
do { \
if (mdbx_log_enabled(MDBX_LOG_VERBOSE)) \