Latest 1.0.5
Homepage https://github.com/pre-dem/pre-dem-cocoa
License MIT
Platforms ios 8.0
Authors

pre-dem-cocoa

Build Status
codecov

简介

pre-dem-cocoa 是由七牛云发起和维护的针对 iOS (Mac OS, Tv OS, Watch OS WIP) 等平台集用户体验监控及报障于一体的开源 SDK,具有无埋点集成,轻量级,高性能等优点

功能清单

功能 版本
crash 监控 v1.0.0
HTTP 性能监控 v1.0.0
UI 卡顿监控 v1.0.0
网络诊断 v1.0.0
自定义事件上报 v1.0.0
log 上报 v1.0.2

安装

使用 CocoaPods 进行安装

pod "PreDemCocoa"

快速开始

  • 初始化
    NSError *error;
    [PREDManager startWithAppKey:@"YOUR_APP_KEY"
                   serviceDomain:@"YOUR_REPORT_DOMAIN"
                        complete:^(BOOL succeess, NSError * _Nullable error) {
                            if (error) {
                                NSLog(@"initialize PREDManager error: %@", error);
                            }
                        }];

初始化之后,SDK 便会自动采集包括 crash、HTTP 请求等监控数据并上报到您指定的服务器

  • 网络诊断
    [PREDManager  diagnose:@"YOUR_SERVER"
                  complete:^(PREDNetDiagResult * _Nonnull result) {
        NSLog(@"new diagnose completed with result:n %@", result);
    }];

网络诊断功能会使用包括 ping, traceroute 等一系列网络工具对您指定的服务器进行网络诊断并将诊断结果上传服务器。

  • log 上报

log 打印

    // 你可以使用你需要的级别打印相关的 log
    PREDLogVerbose(@"verbose log test");
    PREDLogDebug(@"debug log test");
    PREDLogInfo(@"info log test");
    PREDLogWarn(@"warn log test");
    PREDLogError(@"error log test");

log 上报

    // 开始上报指定级别及以上的 log
    [PREDLogger startCaptureLogWithLevel:PREDLogLevelXXX];
    // 停止上报
    [PREDLogger stopCaptureLog];
  • 自定义事件
    NSDictionary *dict = @{
                           @"PARAMETER_KEY1": @"PARAMETER_VALUE1",
                           @"PARAMETER_KEY2": @"PARAMETER_VALUE2"
                           };
    PREDEvent *event = [PREDEvent eventWithName:@"YOUR_EVENT_NAME" contentDic:dict];
    [PREDManager trackEvent:event];

自定义事件上报功能能够将您自定义的事件直接上报至服务器。

Latest podspec

{
    "name": "PreDemCocoa",
    "version": "1.0.5",
    "summary": "A short description of PreDemCocoa.",
    "homepage": "https://github.com/pre-dem/pre-dem-cocoa",
    "license": "MIT",
    "authors": {
        "cnwangsiyu": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pre-dem/pre-dem-cocoa.git",
        "tag": "v1.0.5"
    },
    "platforms": {
        "ios": "8.0"
    },
    "default_subspecs": "Core",
    "pushed_with_swift_version": "3.0",
    "subspecs": [
        {
            "name": "Core",
            "source_files": "PreDemCocoa/**/*.{h,m,mm}",
            "public_header_files": "PreDemCocoa/Public/*.h",
            "vendored_frameworks": "Vendor/*.framework",
            "libraries": [
                "c++",
                "z"
            ],
            "resource_bundles": {
                "PREDResources": "PreDemCocoa/Resources/*.plist"
            },
            "dependencies": {
                "HappyDNS": [],
                "QNNetDiag": [],
                "Qiniu": [],
                "CocoaLumberjack": [],
                "UICKeyChainStore": []
            }
        },
        {
            "name": "Swift",
            "dependencies": {
                "PreDemCocoa/Core": [],
                "CocoaLumberjack/Swift": []
            },
            "source_files": "PreDemCocoa/**/*.{swift}"
        }
    ]
}

Pin It on Pinterest

Share This