Skip to content

Instantly share code, notes, and snippets.

@vurtun
Last active June 11, 2018 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vurtun/a6c1c1cadf6ce05e4f17ad06272818e9 to your computer and use it in GitHub Desktop.
Save vurtun/a6c1c1cadf6ce05e4f17ad06272818e9 to your computer and use it in GitHub Desktop.
#define LIB_DEBUG 2
#if defined(LIB_DEBUG) && (LIB_DEBUG >= 2)
#include <stdio.h>
#define DEBUG_LOG(l, ...) \
if (l <= LIB_DEBUG) { \
fprintf(stderr, "%s(L:%d):, __FILE__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, " \n"); \
}
#else
#define DEBUG_LOG(l, ...){} /* disabled */
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment