iphone - 如何将现有应用程序日志复制到 TestFlight 并使用宏

标签 iphone ios objective-c nslog 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

我现在想将 Testflight 的 TFLog 集成到我们的项目中:

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

我的问题是,是否有一种方法可以将日志记录从 DebugLog 重定向到 TFLog,即 DebugLog 触发并记录到控制台,同时也记录到 TFLog?

最佳答案

使用这个

//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

关于iphone - 如何将现有应用程序日志复制到 TestFlight 并使用宏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14401277/

相关文章:

ios - 如何在iPhone OLED上设置纯红色像素全屏

iphone - 从提要中填充 UIPickerView

ios - 创建 Iphone MapKit 显示用户位置环动画

ios - Swift - UIAlertcontroller 中文本字段的大小

ios - 仅使用一个托管对象预填充核心数据

iphone - iOS 处理多个异步请求 : Send a Signal When All Requests Are Finished

ios - 如何在 MKMapView 中找到中国变换的逆?

ios - 如何使用 Shinobi iOS SDK 打开/关闭图表系列?

objective-c - Objective-C/iPhone 开发中的惰性实例化

iphone - KissXML 不返回字符串