From: Martin Mares Date: Thu, 17 Oct 2013 14:10:33 +0000 (+0200) Subject: Added DBG_SPOT macro X-Git-Tag: v5.99~72 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c79c8c322925710d0954b82043ee0ec758440cb2;p=libucw.git Added DBG_SPOT macro --- diff --git a/ucw/lib.h b/ucw/lib.h index e7518def..c673fb7b 100644 --- a/ucw/lib.h +++ b/ucw/lib.h @@ -146,8 +146,14 @@ void assert_failed_noinfo(void) NONRET; #ifdef LOCAL_DEBUG #define DBG(x,y...) msg(L_DEBUG, x,##y) /** If `LOCAL_DEBUG` is defined before including , log a debug message. Otherwise do nothing. **/ +/** + * If `LOCAL_DEBUG` is defined before including , log current + * file name and line number. Otherwise do nothing. + **/ +#define DBG_SPOT msg(L_DEBUG, "%s:%d (%s)", __FILE__, __LINE__, __func__) #else #define DBG(x,y...) do { } while(0) +#define DBG_SPOT do { } while(0) #endif #ifdef DEBUG_ASSERTS