PLCrashReporter使用
来源:互联网 发布:北京炫彩网络印刷 编辑:程序博客网 时间:2024/05/17 00:53
在didFinishLaunchingWithOptions里面调用init_crash_reporter。如果直接上传崩溃文件好查看些,要转换就麻烦了。
void save_crash_report (PLCrashReporter *reporter)
{
if (![reporter hasPendingCrashReport])
return;
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error;
NSString *path = [[Util getUserFile:@"CrashReport"] stringByAppendingPathComponent:getAppInfo()];
NSData *data = [[PLCrashReporter sharedReporter] loadPendingCrashReportDataAndReturnError: &error];
if (data == nil) {
CLS_LOG(@"Failed to load crash report data: %@", error);
return;
}
BOOL exsist = [fm fileExistsAtPath:path];
NSError *err;
if (exsist) {
[fm removeItemAtPath:path error:&err];
}else{
[data writeToFile: path atomically: YES];
}
CLS_LOG(@"Saved crash report to: %@", path);
}
void init_crash_reporter()
{
PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
NSError *error;
/* Save any existing crash report. */
save_crash_report(crashReporter);
/* Enable the crash reporter */
if (![crashReporter enableCrashReporterAndReturnError: &error]) {
CLS_LOG(@"Could not enable crash reporter: %@", error);
}
/* Add another stack frame */
//stackFrame();
}
void save_crash_report (PLCrashReporter *reporter)
{
if (![reporter hasPendingCrashReport])
return;
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error;
NSString *path = [[Util getUserFile:@"CrashReport"] stringByAppendingPathComponent:getAppInfo()];
NSData *data = [[PLCrashReporter sharedReporter] loadPendingCrashReportDataAndReturnError: &error];
if (data == nil) {
CLS_LOG(@"Failed to load crash report data: %@", error);
return;
}
BOOL exsist = [fm fileExistsAtPath:path];
NSError *err;
if (exsist) {
[fm removeItemAtPath:path error:&err];
}else{
[data writeToFile: path atomically: YES];
}
CLS_LOG(@"Saved crash report to: %@", path);
}
void init_crash_reporter()
{
PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
NSError *error;
/* Save any existing crash report. */
save_crash_report(crashReporter);
/* Enable the crash reporter */
if (![crashReporter enableCrashReporterAndReturnError: &error]) {
CLS_LOG(@"Could not enable crash reporter: %@", error);
}
/* Add another stack frame */
//stackFrame();
}
0 0
- PLCrashReporter使用
- iOS中使用PLCrashReporter收集Crash
- iOS中Crash采集及PLCrashReporter使用
- Crash Report 之第三方框架PLCrashReporter
- Crash Report 之移植PLCrashReporter到自己的app
- 使用
- 使用
- 使用
- 使用
- 使用
- 使用
- 使用++,--
- 使用$@ $!
- 使用
- SoftICE使用(指令使用)
- 使用GraphEdit使用
- 使用HtmlParser使用心得
- 时钟使用使用
- mysql中RowNum的实现
- Free Heap block xxxxxxxx modified at xxxxxxxx after it was freed
- 最舒适的路线
- 第33课第四题
- linuxssh登录验证等候过久解决方法,连接mysql验证时间过久
- PLCrashReporter使用
- linux Oops和Panic关系
- PB实现人民币大写转换函数
- C语言线段树(1)___排兵布阵(hdu 1166)
- SQLServer2008只能编辑前面200行数据
- 事务传播行为
- ANDROID 对VIEW 截图的两种方式
- gdb显示结构体
- java格式化日期和时间