odyssey/sources/debugprintf.h

31 lines
667 B
C
Raw Normal View History

#ifndef OD_DEBUGPRINTF_H
#define OD_DEBUGPRINTF_H
2020-07-26 07:58:15 +00:00
/*
* Odyssey.
*
* Scalable PostgreSQL connection pooler.
*/
void od_dbg_printf(char *fmt, ...);
2020-07-26 07:58:15 +00:00
#define OD_RELEASE_MODE -1
2020-07-26 07:58:15 +00:00
#ifndef OD_DEVEL_LVL
/* set "release" mode by default */
#define OD_DEVEL_LVL OD_RELEASE_MODE
2020-07-26 07:58:15 +00:00
#endif
#if OD_DEVEL_LVL == OD_RELEASE_MODE
#define od_dbg_printf_on_dvl_lvl(debug_lvl, fmt, ...)
/* zero cost debug print on release mode */
#else
2021-04-21 13:11:18 +00:00
#define od_dbg_printf_on_dvl_lvl(debug_lvl, fmt, ...) \
\
if (OD_DEVEL_LVL >= debug_lvl) { \
od_dbg_printf(fmt, __VA_ARGS__); \
}
#endif
2020-07-26 07:58:15 +00:00
#endif /* OD_DEBUGPRINTF_H */