Created
July 8, 2014 18:51
-
-
Save rafaelbartolome/8982022f59c31dc4ab01 to your computer and use it in GitHub Desktop.
NSLog helpers. DLog for debug, ELog for errors, ALog for alertview
This file contains hidden or 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
//********************************* | |
#pragma mark LOGS | |
//********************************* | |
#define RBM_DEBUG | |
// DLog console log for debug | |
#ifdef RBM_DEBUG | |
#define DLog(fmt, ...) NSLog((@"%s[%d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#else | |
#define DLog(...) | |
#endif | |
// ELog console log for errors | |
#define ELog(fmt, ...) NSLog((@"%s[%d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
// ALog (alert view) | |
#ifdef RBM_DEBUG | |
#define ALog(fmt, ...) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [%d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; } | |
#else | |
#define ALog(...) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment