自定义ios NSLog

#ifdef DEBUG

#define MyLog(FORMAT, ...) fprintf(stderr,"Time:%s\t File:%s\t Methods:%s\t Line:%d\t Info:%s", __TIME__,[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],__func__,__LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])

#else

   #define MyLog(FORMAT, ...) nil

#endif

posted on 2016-08-15 14:41  许鸣  阅读(178)  评论(0编辑  收藏  举报