美文网首页
iOS/OC: XCode8自定义调试打印日志

iOS/OC: XCode8自定义调试打印日志

作者: 疯狂的向日葵 | 来源:发表于2016-11-16 15:56 被阅读80次

    debug的时候打印日志输出文件名/第几行...略去了时间戳信息

    #ifdef DEBUG
    #define JLLog(FORMAT, ...) fprintf(stderr,"%s:第 %d 行\n%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
    #else
    #define JLLog(...)
    #endif
    

    相关文章

      网友评论

          本文标题:iOS/OC: XCode8自定义调试打印日志

          本文链接:https://www.haomeiwen.com/subject/risrpttx.html