mirror of
https://github.com/facebook/zstd.git
synced 2025-12-02 00:02:47 -05:00
add line number to debug traces
This commit is contained in:
parent
7c2aa73a8e
commit
9cc3304614
@ -92,10 +92,14 @@ extern int g_debuglevel; /* the variable is only declared,
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define STRINGIFY(x) #x
|
||||||
|
#define TOSTRING(x) STRINGIFY(x)
|
||||||
|
#define LINE_AS_STRING TOSTRING(__LINE__)
|
||||||
|
|
||||||
# define DEBUGLOG(l, ...) \
|
# define DEBUGLOG(l, ...) \
|
||||||
do { \
|
do { \
|
||||||
if (l<=g_debuglevel) { \
|
if (l<=g_debuglevel) { \
|
||||||
ZSTD_DEBUG_PRINT(__FILE__ ": " __VA_ARGS__); \
|
ZSTD_DEBUG_PRINT(__FILE__ ":" LINE_AS_STRING ": " __VA_ARGS__); \
|
||||||
ZSTD_DEBUG_PRINT(" \n"); \
|
ZSTD_DEBUG_PRINT(" \n"); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user