Created
May 16, 2010 11:17
-
-
Save kompozer/402826 to your computer and use it in GitHub Desktop.
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
#ifdef DEBUG | |
// Debug log | |
#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) | |
// Assert log | |
#define ASLog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__] | |
#else | |
#define DLog(...) do { } while (0) | |
#ifndef NS_BLOCK_ASSERTIONS | |
#define NS_BLOCK_ASSERTIONS | |
#endif | |
#define ASLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) | |
#endif | |
// Always log | |
#define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) | |
#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0) | |
// From http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment