Skip to content

Instantly share code, notes, and snippets.

@tyama
Created June 6, 2014 12:09
Show Gist options
  • Save tyama/4a9585033727d2b53b1f to your computer and use it in GitHub Desktop.
Save tyama/4a9585033727d2b53b1f to your computer and use it in GitHub Desktop.
log macro
#ifdef DEBUG
# define LOG(...) NSLog(__VA_ARGS__)
# define LOG_CURRENT_METHOD NSLog(@"%@/%@", NSStringFromClass([self class]), NSStringFromSelector(_cmd))
# define LogPoint(p) LOG(@"%s:%@",#p,NSStringFromCGPoint(p))
# define LogRect(r) LOG(@"%s:%@",#r,NSStringFromCGRect(r))
# define LogSize(s) LOG(@"%s:%@",#s,NSStringFromCGSize(s))
#else
# define LOG(...) ;
# define LOG_CURRENT_METHOD ;
# define LogPoint(p) ;
# define LogRect(p) ;
# define LogSize(p) ;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment