自定义NSLog

1、

#define  MYNSLog(...)  NSLog(__VA_ARGS__)

2、

#define MYONELog(formatStr, ...) fprintf(stderr,"file:%s line:%d func:%s  %s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__,__func__, [[NSString stringWithFormat:formatStr, ##__VA_ARGS__] UTF8String]);

3、

#define MYTWOLog(formatString,...) NSLog(@"file:%@ func:%s line:%d  "formatString, [[NSString stringWithUTF8String:__FILE__] lastPathComponent] , __func__, __LINE__, ##__VA_ARGS__)


你可能感兴趣的:(nslog,自定义NSLog)