Xcode 自定义Log

常用写法,功能简单:

#ifdef DEBUG
#define JFLog(...)  NSLog(__VA_ARGS__)

#else
#define JFLog(...)

#endif




更复杂的写法,能打印更多调试信息:

#ifdef DEBUG

#define JFLog(...)  NSLog(@"%s %d\n %@\n", __func__, __LINE__, [NSString stringWithFormat:__VA_ARGS__])

#else

#define JFLog(...)

#endif





你可能感兴趣的:(Xcode 自定义Log)