导入:

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使用的更多相关文章

  1. 【腾讯bugly干货分享】HTML 5 视频直播一站式扫盲

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://bugly.qq.com/bbs/forum.php?mod=viewthread&tid=1277 视频直 ...

  2. 【腾讯Bugly干货分享】Android Linker 与 SO 加壳技术

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57e3a3bc42eb88da6d4be143 作者:王赛 1. 前言 Andr ...

  3. 【腾讯Bugly干货分享】Android性能优化典范——第6季

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/580d91208d80e49771f0a07c 导语 这里是Android性能优 ...

  4. 【腾讯Bugly经验分享】程序员的成长离不开哪些软技能?

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57ce8068d4d44a246f72baf2 Dev Club 是一个交流移动 ...

  5. 【腾讯Bugly干货分享】基于 Webpack & Vue & Vue-Router 的 SPA 初体验

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57d13a57132ff21c38110186 导语 最近这几年的前端圈子,由于 ...

  6. 【腾讯Bugly干货分享】WebVR如此近-three.js的WebVR示例解析

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57c7ff1689a6c9121b1adb16 作者:苏晏烨 关于WebVR 最 ...

  7. 【腾讯Bugly干货分享】Android动态布局入门及NinePatchChunk解密

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57c7ff5d53bbcffd68c64411 作者:黄进——QQ音乐团队 摆脱 ...

  8. 【腾讯Bugly干货分享】基于RxJava的一种MVP实现

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57bfef673c1174283d60bac0 Dev Club 是一个交流移动 ...

  9. 【腾讯Bugly干货分享】动态链接库加载原理及HotFix方案介绍

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57bec216d81f2415515d3e9c 作者:陈昱全 引言 随着项目中动 ...

  10. 【腾讯Bugly干货分享】微信iOS SQLite源码优化实践

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57b58022433221be01499480 作者:张三华 前言 随着微信iO ...

随机推荐

  1. SparkContext源码阅读

    SparkContext是spark的入口,通过它来连接集群.创建RDD.广播变量等等. class SparkContext(config: SparkConf) extends Logging w ...

  2. 【转】贾扬清:希望Caffe成为深度学习领域的Hadoop

    [转:http://www.csdn.net/article/2015-07-07/2825150] 在深度学习(Deep Learning)的热潮下,Caffe作为一个高效.实用的深度学习框架受到了 ...

  3. python中利用logging包进行日志记录时的logging.level设置选择

    之前在用python自带的logging包进行日志输出的时候发现有些logging语句没有输出,感到比较奇怪就去查了一下logging文档.然后发现其在设置和引用时的logging level会影响最 ...

  4. Gocd持续部署利器

    http://www.go.cd/documentation/user/current http://www.go.cd/images/home-image1.png Gocd 是ThoughtWor ...

  5. linux文件上传

    租了个服务器,要把自己打的war包打上去发布,服务器是linux的(本机是mac).以前都是用wget命令,把需要上传的东西先放到github上面再在服务器上用wget命令下载.最近不知道什么原因,w ...

  6. 用webview打开网页时,里面有个div带滚动条的,但是在平板上滚动条失效

    android2.3的不支持滚动条,并且scrollTop也不支持的.(设置overflow未hidden就可以支持). function noBarsOnTouchScreen(arg) { var ...

  7. 相同的问题又出现了,struts2取不出数值

    debug里面是有数值的,不知道是不是又是表示错了.全部改成了小写也无济于事.正在想法解决中... 问题解决了,因为自己的不仔细,问题还是出在了action的set,get方法里,不是大小写没注意,改 ...

  8. 利用jquery实现自动登录

    前提是需要引入jquery和jquery.cookie html 用户名:<input type="text" id="name"/><br ...

  9. 【转载】C++ IO库

    本篇随笔为转载,原贴地址:<C++ Primer>第8章 IO库 学习笔记. 1.IO类 #include <iostream> istream//从流中读取数据 ostrea ...

  10. Hibernate的配置文件以及用法

    一. 三大框架 Hibernate 1.安装hibernate插件至ecilpse 2.进行配置 2.1 主配置文件 <?xml version="1.0" encoding ...