导入:

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. R中,去掉dataframe中的NA行

    R中使用complete.cases 和 na.omit来去掉包含NA的行 现在有个一data.frame  datafile如下所示 Date        sulfate nitrate ID 1 ...

  2. vue.js 2.0开发

    创建一个工程文件: css中引用的是bootstrap的css,js中就是vue,index页面: <!DOCTYPE html> <html> <head> &l ...

  3. Android Gradle 技巧之二: 最爱命令行

    命令行 很多做 Android 开发不久的同学,习惯于使用图形界面,对命令行操作很陌生甚至恐惧.遇到 AS 运行错误,束手无策.AS 为了确保易用性,也在 UI 界面上屏蔽了很多命令行运行的细节,导致 ...

  4. Django model 中meta options之 abstract

    当abstract=True时,这个model就变成了abstrct base class,那这个基类有什么特性呢? 当某一model中设置了abstract=True时,就会使该model中的字段都 ...

  5. QQ粘性布局

    *:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...

  6. 去块率波 Deblocking filter

    基于块的视频编码的一个典型特点就是在图像中会出现偶发的可察觉的块结构,这是由于重构块的边缘像素与块内部像素相比恢复精度要低,块效应是目前压缩编码最明显的视觉失真之一.在H.264/ AVC视频编码标准 ...

  7. Good Bye 2013 A

    A. New Year Candles time limit per test 1 second memory limit per test 256 megabytes input standard ...

  8. google快捷键,通过浏览器本身来查看

    今天玩google浏览器时发现一个不需要访问google就能查看其快捷键的方式,再此记录一下,以备后用. 1:打开Google浏览器 2:打开开发者工具,有三种方法 2-1:按F12快捷键 2-2:按 ...

  9. Linux学习笔记——使用指定的用户权限执行程序——sudo

          sudo可以用来以其他用户身份执行命令,sudo命令可以针对单个命令授予临时权限.sudo仅在需要时授予用户权限,减少了用户因为错误执行命令损坏系统的可能性. 1:sudo的帮助信息如下: ...

  10. WampServer服务中MySQL无法正常启动解决方案

    打开wampserver->mysql->my.ini,添加或修改innodb_force_recovery = 1 然后重启所有服务就大功告成了!