]> mj.ucw.cz Git - libucw.git/commitdiff
Added DBG_SPOT macro
authorMartin Mares <mj@ucw.cz>
Thu, 17 Oct 2013 14:10:33 +0000 (16:10 +0200)
committerMartin Mares <mj@ucw.cz>
Thu, 17 Oct 2013 14:10:33 +0000 (16:10 +0200)
ucw/lib.h

index e7518defa3d64a30cbcdfe9b39e9a3cbfc1fa21a..c673fb7bc7e1e09d51a4676b24c549ea0e44bf78 100644 (file)
--- 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 <ucw/lib.h>, log a debug message. Otherwise do nothing. **/
+/**
+ * If `LOCAL_DEBUG` is defined before including <ucw/lib.h>, 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