objective c一个更好的日志方案代码
// Macro voodo? Will not be printed if application is build with -DPRODUCTION // Ex. Log(@"String with %s", @"Formatting"); #ifndef PRODUCTION #define Log(format, ...) \ NSLog(@"(%s)[%s:%d] %s", __FUNCTION__,__FILE__,__LINE__, [[NSString stringWithFormat:format, ##__VA_ARGS__] UTF8String]) #else #define Log(format, ...) /* NOT USED IN PRODUCTION */ #endif