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 ...
随机推荐
- js零散总结
字符串的查找 index of 指定查找位置 可以查所有,不支持正则 找不到返回-1 var i=-1; while((i=str.indexOf("关键词",i+1))!=- ...
- KT vs SKT [20160816]
KT:索尔 SKT:茂凯,塔里克,卡西奥佩娅 普朗克+烬,大招开团. 塔里克保护,眩晕.
- (整理)SQLServer_DBA 工具
本文是SQLserver DBA 相关工具使用资料链接整理. SQLServer DBA 十大工具:http://www.cnblogs.com/fygh/archive/2012/04/25/246 ...
- HDFS--(HA)初始化与启动
1.启动zk 2.启动journalnode: hadoop-daemons.sh start journalnode 3.格式化zkfc--让在zookeeper中生成ha节点 ...
- Jmeter组件3. HTTP Cookie Manager
两个坑的地方 如果一个域(scope)内有两个cookie manager,Jmeter说,我分不清了,你自己看着办吧,所以不要没事找事,一个域内一个cookie manager够了 用户自定义coo ...
- java测试题总结
1.Struts2处理来自多个页面的同一个Action请求,那么它们是不是同一个action. struts2中每个请求都是独立的.每一次请求都会去new一个新的action,所有写在action中的 ...
- IO同步、异步与阻塞、非阻塞
一.同步与异步同步/异步, 它们是消息的通知机制 1. 概念解释A. 同步所谓同步,就是在发出一个功能调用时,在没有得到结果之前,该调用就不返回. 按照这个定义,其实绝大多数函数都是同步调用(例如si ...
- 给JAVA初学者的50个忠告
摘自: http://wenku.baidu.com/link?url=p5vDKt5bKzUXxG_hAsB9XopHJRROeovOGGh4jnXGZXiUedR-fNOLO7zb6ddENo5U ...
- java面试笔试
一.String,StringBuffer, StringBuilder 的区别是什么?String为什么是不可变的? String在Java中是final的类,所以不可变:StringBuffer是 ...
- regular expressions