Skip to content

Instantly share code, notes, and snippets.

@pallas
Created August 28, 2019 21:33
Show Gist options
  • 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