导入:

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. 数据结构&算法-单链表

    1.引言 工作一年了,感觉越来越懒散,把很多基础性的东西都慢慢遗忘了,最近想趁着还没忘完,回顾一下,整理了点笔记,分享一下. 如有错的地方,欢迎大家怒喷. 2.学习 我们就从最简单的链表开始吧. 链表 ...

  2. Blackfin DSP(八):BF533的DMA

    #include <cdefBF533.h> #include <sys\exception.h> #define POLC 0x00004000 #define PORT_C ...

  3. Flex中使用CSS控制页面样式

    Using file: Stylebounding.mxml Stylebounding2.mxml myCSS0329.css 在Flex4中使用CSS控制样式,既可以直接在MXML文件中写样式,也 ...

  4. csdn的资源使用

    资源库: http://lib.csdn.net/

  5. X32,X64,X86 代表什意义

    X32,X64,X86是什么意思 各代表什么:X86指32位,X64指64位,现在用户最多的是XP,但win7是趋势,发展很快,建议你装个win7 32位的系统,下载的话地方很多,官方安装原版和gho ...

  6. gcc相关

    linux操作系统上面开发程序, 光有了gcc 是不行的 它还需要一个   build-essential软件包作用是提供编译程序必须软件包的列表信息 也就是说 编译程序有了这个软件包它才知道 头文件 ...

  7. 获取Spring容器中的Bean

    摘要 SpringMVC框架开发中可能会在Filter或Servlet中用到spring容器中注册的java bean 对象,获得容器中的java bean对象有如下方法 Spring中的Applic ...

  8. SQL SERVER 批量插入记录

    --create function insertData(@count as int,@tsn as bigint,@id as int) --as --begin SET IDENTITY_INSE ...

  9. android_Activity之Button_OnClickListener

    今天我们要讲的主要是四大组件之一Activity 什么是Android 的四大组件呢?接下来简单了解下. 1.Activity  Activity就是我们应用程序的界面,主要用来跟我们的用户进行交互的 ...

  10. GUI开发者桌面搜索文件工具

    # - *- coding:utf-8-*-from Tkinter import *import tkMessageBoximport tkFileDialogimport osimport fnm ...