DaffodilGirl 2013-01-21 05:31 采纳率: 0%
浏览 2213
已采纳

复制当前应用日志到TestFlight

当前正在集成测试SDK,有一个名为DebugLog日志宏命令:

#ifdef DEBUG
    #define DebugLog(s,...) NSLog(@"Thread:%@  [%@ %@] %@", [[NSThread currentThread] name], NSStringFromClass([self class]), NSStringFromSelector(_cmd), [NSString stringWithFormat:s,##__VA_ARGS__])
#else
    #define DebugLog(s,...)
#endif

现在要将TFLog集成到工程中来:

#define NSLog(__FORMAT__, ...) TFLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

问题是,有没有办法能让DebugLog的日志重新定向到TFLog中?比如,DebugLog启动记录到控制台,同时也记录到TFLog中。
谢谢。

  • 写回答

1条回答 默认 最新

  • xinyoulingxi1_tong 2013-01-21 05:50
    关注

    用用我的代码:

    //Here I have added NSLog followed by TFLog
    #define DebugLog(s,...) NSLog(@"Thread:%@  [%@ %@] %@", [[NSThread currentThread] name], NSStringFromClass([self class]), NSStringFromSelector(_cmd), [NSString stringWithFormat:s,##__VA_ARGS__]);TFLog(s,##__VA_ARGS__)
    //You can use this within  #ifdef #endif construct
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料