bugly使用
导入:
1.Bugly.framework
2.Security.framework
3.SystemConfiguration.framework
4.libc++.1.dylib
5.libz.1.dylib
AppDelegate.m 设置如下:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self setupBugly];
return YES;
}
- (void)setupBugly {
// Get the default config
BuglyConfig * config = [[BuglyConfig alloc] init];
// Open the debug mode to print the sdk log message.
// Default value is NO, please DISABLE it in your RELEASE version.
#if DEBUG
config.debugMode = YES;
#endif
// Open the customized log record and report, BuglyLogLevelWarn will report Warn, Error log message.
// Default value is BuglyLogLevelSilent that means DISABLE it.
// You could change the value according to you need.
config.reportLogLevel = BuglyLogLevelWarn;
// Open the STUCK scene data in MAIN thread record and report.
// Default value is NO
config.blockMonitorEnable = YES;
// Set the STUCK THRESHOLD time, when STUCK time > THRESHOLD it will record an event and report data when the app launched next time.
// Default value is 3.5 second.
config.blockMonitorTimeout = 1.5;
// Set the app channel to deployment
config.channel = @"Bugly";
config.delegate = self;
// NOTE:Required
// Start the Bugly sdk with APP_ID and your config
[Bugly startWithAppId:BUGLY_APP_ID
#if DEBUG
developmentDevice:YES
#endif
config:config];
// Set the customizd tag thats config in your APP registerd on the bugly.qq.com
// [Bugly setTag:1799];
[Bugly setUserIdentifier:[NSString stringWithFormat:@"User: %@", [UIDevice currentDevice].name]];
[Bugly setUserValue:[NSProcessInfo processInfo].processName forKey:@"Process"];
// NOTE: This is only TEST code for BuglyLog , please UNCOMMENT it in your code.
//[self performSelectorInBackground:@selector(testLogOnBackground) withObject:nil];
}
/**
* @brief TEST method for BuglyLog
*/
- (void)testLogOnBackground {
int cnt = 0;
while (1) {
cnt++;
switch (cnt % 5) {
case 0:
BLYLogError(@"Test Log Print %d", cnt);
break;
case 4:
BLYLogWarn(@"Test Log Print %d", cnt);
break;
case 3:
BLYLogInfo(@"Test Log Print %d", cnt);
BLYLogv(BuglyLogLevelWarn, @"BLLogv: Test", NULL);
break;
case 2:
BLYLogDebug(@"Test Log Print %d", cnt);
BLYLog(BuglyLogLevelError, @"BLLog : %@", @"Test BLLog");
break;
case 1:
default:
BLYLogVerbose(@"Test Log Print %d", cnt);
break;
}
// print log interval 1 sec.
sleep(1);
}
}
#pragma mark - BuglyDelegate
- (NSString *)attachmentForException:(NSException *)exception {
NSLog(@"(%@:%d) %s %@",[[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, __PRETTY_FUNCTION__,exception);
return @"This is an attachment";
}
bugly使用的更多相关文章
- 【腾讯bugly干货分享】HTML 5 视频直播一站式扫盲
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://bugly.qq.com/bbs/forum.php?mod=viewthread&tid=1277 视频直 ...
- 【腾讯Bugly干货分享】Android Linker 与 SO 加壳技术
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57e3a3bc42eb88da6d4be143 作者:王赛 1. 前言 Andr ...
- 【腾讯Bugly干货分享】Android性能优化典范——第6季
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/580d91208d80e49771f0a07c 导语 这里是Android性能优 ...
- 【腾讯Bugly经验分享】程序员的成长离不开哪些软技能?
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57ce8068d4d44a246f72baf2 Dev Club 是一个交流移动 ...
- 【腾讯Bugly干货分享】基于 Webpack & Vue & Vue-Router 的 SPA 初体验
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57d13a57132ff21c38110186 导语 最近这几年的前端圈子,由于 ...
- 【腾讯Bugly干货分享】WebVR如此近-three.js的WebVR示例解析
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57c7ff1689a6c9121b1adb16 作者:苏晏烨 关于WebVR 最 ...
- 【腾讯Bugly干货分享】Android动态布局入门及NinePatchChunk解密
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57c7ff5d53bbcffd68c64411 作者:黄进——QQ音乐团队 摆脱 ...
- 【腾讯Bugly干货分享】基于RxJava的一种MVP实现
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57bfef673c1174283d60bac0 Dev Club 是一个交流移动 ...
- 【腾讯Bugly干货分享】动态链接库加载原理及HotFix方案介绍
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57bec216d81f2415515d3e9c 作者:陈昱全 引言 随着项目中动 ...
- 【腾讯Bugly干货分享】微信iOS SQLite源码优化实践
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57b58022433221be01499480 作者:张三华 前言 随着微信iO ...
随机推荐
- 加快phpstorm、rubymine、pycharm系列IDE运行速度的方法
对jetbrains公司出品的IDE均有效,以rubymine为例: 打开C:\Program Files\JetBrains\RubyMine 6.3.3\bin,打开 rubymine.exe.v ...
- Esfog_UnityShader教程_逐帧动画
有段日子没出这个系列的新文章了,今天就拿一个比较常见也比较基础的利用改变Shader来改变不断调整UV实现播放逐帧动画的小功能.很久没写了就当练练手了.在新版本的Unity中早就已经集成了Sprite ...
- hive和ORACLE语法对比
- 使用JDBC进行批处理
在实际的项目开发中,有时候需要向数据库发送一批SQL语句执行,这时应避免向数据库一条条的发送执行,而应采用JDBC的批处理机制,以提升执行效率. JDBC实现批处理有两种方式:statement和pr ...
- PHP基础课程学习总结
时间过得很快,不知不觉中过去了一个月,PHP基础课程已经学完了.休息这几天中,睡觉起来,整理下笔记,几天的假期又过去了,明天正式开始PHP的专业课程,新的征途又要开始了.开发整站时发现,过去整站做得太 ...
- NDK 的开发流程
1.NDK开发所需要的工具 windows 需要在windows下的环境 把c代码打包成 手机能用的函数库 首先模拟手机的环境 1 NDK .sh linux 批处理文件 .bat windows 头 ...
- 【EF学习笔记10】----------主从表级联操作
主从表 级联新增 Console.WriteLine("=========主从表 级联新增=========="); using (var db = new Entities()) ...
- Android 环境常见问题
1.启动adb时报: adb server is out of data.kill... ADB server didn't ACK *failed to start daemon* er ...
- css的一种预处理器 sass
之前觉得关于css什么的没什么,后来让别人给问住了...然后就悲催了... sass是一种css的预处理器,是一种函数式的css的编程: 主要还是看官网 http://www.w3cplus.com/ ...
- Java和C++中的static
1.Java类中的static变量和static方法会在类装载的过程中就得到内存分配,然后就会进行初始化工作.最多可能会被初始化3次,静态代码块的执行在main方法之前. static变量不可以在构造 ...