导入:

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. access remote libvirtd

    访问远程libvirtd服务因为是在一个可信环境中运行,所以可以忽略安全方面的操作,步骤如下:(1)更改libvirtd配置    1.1 更改/ect/sysconfig/libvirtd文件,打开 ...

  2. ADF_Controller系列3_通过创建ADF Menu作为页面向导(Part1)

    2015-02-15 Created By BaoXinjian

  3. 【摘】top命令

    1.重要参数解释 VIRT:virtual memory usage.Virtual这个词很神,一般解释是:virtual adj.虚的, 实质的, [物]有效的, 事实上的.到底是虚的还是实的?让G ...

  4. autoit 中_GUICtrlStatusBar_SetBkColor失效的解决办法

    #include <GuiConstantsEx.au3> #include <GuiStatusBar.au3> #include <WinAPI.au3> #i ...

  5. C#如何定义全局变量

    C#中没有全局变量的概念,可以定义一个common类,通过静态变量来存放所有需要的全局变量,调用的时候通过common来调用即可. 例如:  public static class common // ...

  6. SQL笔记 [长期更新] (-2015.4)

    [遍历所有表,复制表结构,复制表数据] --插入语句SELECT * INTO A FROM B 是在还没有A表的情况下,直接通过B表创建并把B表数据复制到A表里面,之后A,B表的结构和数据完全一样. ...

  7. Mysql 存储过程基本语法

    delimiter //一般情况下MYSQL以:结尾表示确认输入并执行语句,但在存储过程中:不是表示结束,因此可以用该命令将:号改为//表示确认输入并执行. 一.创建存储过程 1.基本语法: crea ...

  8. sublime text3 输入中文的解决方法及注册

    让它输入中文的原理就是给sublime text3给打上个补丁libsublime-imfix.so,这个补丁可以直接git回来,或者下载补丁的源码编译安装. Ubuntu可以直接按照下面的教程 su ...

  9. 第19章 queue队列容器

    /* 第19章 queue队列容器 19.1 queue技术原理 19.2 queue应用基础 19.3 本章小结 */ // 第19章 queue队列容器 // 19.1 queue技术原理 // ...

  10. RegExp 对象的三个方法:compile()、exec()、test()

    这三个都是RegExp对象下的三个方法,使用方法是一致得. 使用方法:RegExpObject.方法() 方法解析:其实就是根据定义好的正则对象,调用对应的方法. 1.RegExpObject.com ...