Tuesday, September 25, 2012

iOS : How to disable all NSLog for release


1. Rename your all NSLog to MyLog

2. Add this code to your -Prefix.pch file

#ifdef __OBJC__
#import 
#import 


#ifdef DEBUG  
#define MyLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);

#else  
#define MyLog(...)

No comments:

Post a Comment