diff --git a/include/maxscale/debug.h b/include/maxscale/debug.h index e78ada35a..c2f3532d0 100644 --- a/include/maxscale/debug.h +++ b/include/maxscale/debug.h @@ -35,10 +35,12 @@ MXS_BEGIN_DECLS #if defined(SS_DEBUG) && defined(LOG_ASSERT) #include # define ss_dassert(exp) do { if(!(exp)){\ - MXS_ERROR("debug assert %s:%d\n", (char*)__FILE__, __LINE__);\ + const char *debug_expr = #exp; /** The MXS_ERROR marco doesn't seem to like stringification */ \ + MXS_ERROR("debug assert at %s:%d failed: %s\n", (char*)__FILE__, __LINE__, debug_expr);\ mxs_log_flush_sync(); assert(exp);} } while (false) #define ss_info_dassert(exp,info) do { if(!(exp)){\ - MXS_ERROR("debug assert %s:%d %s\n", (char*)__FILE__, __LINE__, info);\ + const char *debug_expr = #exp; \ + MXS_ERROR("debug assert at %s:%d failed: %s (%s)\n", (char*)__FILE__, __LINE__, info, debug_expr);\ mxs_log_flush_sync();assert(exp);} } while (false) # define ss_debug(exp) exp # define ss_dfprintf fprintf