iOS application publishing shield NSLog

  During the development process, often you need to use NSLog for debugging, but NSLog is very affecting performance, so we should shield the NSLog when publishing the application, but if the line by hand to a line change was, then, would be too boring and time-consuming the, fortunately, we can be shielded by NSLog conditions precompiled. Sample code is as follows:

// place in the project to be printed using WKLog 
/ * * 
 * the application of two states: 
 * Debug (debug): during the development phase belong to the commissioning phase, the system will customize a DEBUG macro 
 * Release (release): the system will automatically delete the macro DEBUG 
 * / 
#ifdef DEBUG 

#define WKLog (...) NSLog (__ VA_ARGS__) #else #define WKLog (...) #endif

 



 

Reproduced in: https: //www.cnblogs.com/pretty-guy/p/4080552.html

Guess you like

Origin blog.csdn.net/weixin_33985679/article/details/94287744