导入:

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. HTML标签_01

    <!DOCTYPE html> <html> <body> <h1>我的第一个标题</h1> <p>我的第一个段落.</p ...

  2. [Linux] Linux下谁在消耗我们的cache

    一.缘由: 曾经看到MySQL服务器上Cache占用特别大,其实大家都知道这是合理的,这些都是可用内存: 那么问题来了,是谁在占用这些Cache呢?如果去掉不合理的Cache占用,系统内存会更充分的得 ...

  3. ssh配置文件说明

    配置“/etc/ssh/ssh_config”文件 “/etc/ssh/ssh_config” 文件是OpenSSH系统范围的配置文件,允许你通过设置不同的选项来改变客户端程序的运行方式.这个文件的每 ...

  4. NGUI之渲染DrawCall的合并

    在Unity中,每次引擎准备数据并通知GPU的过程称为一次Draw Call.Draw Call值越低,会得到更好的渲染性能. (NGUI 查看DrawCall工具(NGUI-OPEN-Draw Ca ...

  5. ios多线程开发的常用三种方式

    1.NSThread 2.NSOperationQueue 3.GCD NSThread: 创建方式主要有两种: [NSThread detachNewThreadSelector:@selector ...

  6. debian8(jessie)安装小记

    其实上周五就想写这篇博客了,一直忙着没时间,虽然也不知道自己这一个星期到底在忙什么.这次我是彻底告别windows了,安装的过程略为艰辛,因为之前习惯了deepin和ubuntu的傻瓜式安装,而deb ...

  7. 剑指Offer:面试题24——二叉搜索树的后序遍历序列(java实现)

    问题描述: 输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果.如果是则返回true,否则返回false.假设输入的数组的任意两个数字都互不相同. 思路: 1.首先后序遍历的结果是[(左子 ...

  8. cookie sessionStorage localStorage 区别

    sessionStorage 和 localStorage 是HTML5 Web Storage API 提供的,可以方便的在web请求之间保存数据.有了本地数据,就可以避免数据在浏览器和服务器间不必 ...

  9. ssh通道技术

    所有机器均为Linux操作系统.   机器是A,中间服务器为B,目标服务器是C. 从A可以ssh到B,从B可以ssh到C,但是A不能直接ssh到C. 现在展示利用ssh通道技术从A直接传输文件到C. ...

  10. 使用get传参的时候,参数在后头获取不到或者出现别的错误。

    把传递的参数使用encode转换一下,符合HTTP规定的编码,再使用. String encode = java.net.URLEncoder.encode("VSrYJoDat8z7Ad9 ...