Created
January 8, 2015 15:39
-
-
Save NeoTeo/4f25ab0ef75aba94c7aa to your computer and use it in GitHub Desktop.
Cocoa/Objective-C Macro for tagged debug logging.
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
// Here are the definitions of the tags used to toggle the various debug logs. | |
//#define TGLOG_ALL | |
#define TGLOG_TMP | |
#define TGLog(tag, msg, ...) TGLog_eval_(TGLog_do_, tag, msg, ## __VA_ARGS__) | |
#define TGLog_eval_(macro, ...) macro(__VA_ARGS__) | |
#define TGLog_do_(tag, msg, ...) \ | |
(#tag[0] == 0 || #tag[0] == '1') ? NSLog(@"%@",[NSString stringWithFormat:msg, ## __VA_ARGS__]) : (void)0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usually included in the project's precompiled header file