Created
August 28, 2019 21:33
-
-
Save pallas/699fb8503af3ced2181f0900ced9d9eb to your computer and use it in GitHub Desktop.
Simple but powerful debugging primitive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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