Skip to content

Instantly share code, notes, and snippets.

@cruffenach
Created August 29, 2011 17:49
Show Gist options
  • Save cruffenach/1178932 to your computer and use it in GitHub Desktop.
Save cruffenach/1178932 to your computer and use it in GitHub Desktop.
Prefix Header with helpful log methods DLog and DStep
//
// Prefix header for all source files
//
#ifdef __OBJC__
#endif
#ifndef DLog
#if kDebug
#define DLog( s, ... ) NSLog( @"\n\n************************************* DEBUG *************************************\n\t<%p %@:(%d)>\n\n\t%@\n*********************************************************************************\n\n", self, \
[[NSString stringWithUTF8String:__FUNCTION__] lastPathComponent], __LINE__, \
[NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DLog( s, ... )
#endif
#endif
#ifndef DStep
#if kDebug
#define DStep( s, ... ) NSLog( @"\n\n************************************* DEBUG *************************************\n\t%@\n*********************************************************************************\n\n", [NSString stringWithFormat:(s), ##__VA_ARGS__])
#else
#define DStep( s, ... )
#endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment