Skip to content

Instantly share code, notes, and snippets.

@pallas
Created August 28, 2019 21:33
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 pallas/699fb8503af3ced2181f0900ced9d9eb to your computer and use it in GitHub Desktop.
Save pallas/699fb8503af3ced2181f0900ced9d9eb to your computer and use it in GitHub Desktop.
Simple but powerful debugging primitive
// SPDX-License-Identifier: Unlicense
bool global_debug = false;
#define DEBUG(format, ...) do { \
if (global_debug) \
fprintf(stderr, "%s:%d %s " format "\n", __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__); \
} while(false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment