CaptureLogger已被BugshotKit修改。支持所有iOS版本。
简单用法
在Podfile文件中
pod 'CaptureLogger', :configurations => ['Debug']
--
在.pch文件中
#if DEBUG
# import "CLCaptureLogger.h"
# define NSLog(format,...) CLLog(format,##__VA_ARGS__)
[BugshotKit addLogMessage:[NSString stringWithFormat:@"<%@,%d>:%@\n",[[NSString stringWithUTF8String:__FILE__] lastPathComponent],__LINE__,[NSString stringWithFormat:format, ## __VA_ARGS__]]]
#else
# define NSLog(format, ...)
#endif
其他方面您可以使用CLLog代替NSLog。
-- 在AppDelegate.m文件中
#if DEBUG
# import "CLCaptureLogger.h"
# import "CLBugshotManager.h"
#endif
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
#if DEBUG
[CLCaptureLogger captureLoggerGestureEnable];
[[CLBugshotManager sharedManager] setDisplayConsoleTextInLogViewer:YES];
#endif
...
}