#ifdef DEBUG //调试 #define NSLog(FORMAT, ...) fprintf(stderr, "%s:%zd %s ", [[[NSString stringWithUTF8String: __FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat: FORMAT, ## __VA_ARGS__] UTF8String]); #else // 发布 #define NSLog(FORMAT, ...) nil #endif