Latest 1.3.0
Homepage https://github.com/393385724/DDLogger
License MIT
Platforms ios 7.0, requires ARC
Dependencies ICTextView
Frameworks CoreTelephony, SystemConfiguration, Foundation, CoreGraphics, UIKit
Authors

a log redirect to file ,建议使用最新版本,1.3.0版本之前容易丢失log,建议采用加密log不易丢失

警告:重大变更,接口有改变,引用了腾讯的xlog框架,升级者慎用,工程中有解码脚本使用方法如下:
python 脚本路径/decode_mars_log_file.py 日志路径/日志名字.xlog

将NSLog替换为DDLog或者重新定义NSLog参见DDLog的定义可以在release模式下重向log到预先定义的日志目录
使用方法:
前提使用的cocopods
pod ‘DDLogger’, ‘~> 1.3.0’

开始收集log

  • (void)startLogWithCacheDirectory:(NSString )cacheDirectory
    nameprefix:(NSString
    )nameprefix
    encrypt:(BOOL)encrypt;

@code

  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {

    NSArray paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString
    docDir = [paths objectAtIndex:0];
    [[DDLogger Logger] startLogWithCacheDirectory:docDir nameprefix:@"hm" encrypt:NO];

    return YES;

}

@endcode

停止收集log

  • (void)stopLog;

当前是否显示logView

  • (BOOL)isShowLogView;

显示logView

  • (void)showLogView;

隐藏logView

  • (void)hidenLogView;

查看本地存在的log日志

@param viewController 当前的Viewontroller

@param handler 选取回调结果

  • (void)pikerLogWithViewController:(UIViewController *)viewController eventHandler:(DDPikerLogEventHandler)handler;

Iteration

2016-11-02 fix flushToDiskSync crash -[__NSArrayM getObjects:range:]: range {0, 1} extends beyond bounds for empty array

2016-02-10 change 1、可选对异常的捕捉 2、调整log宏 3、可在查看本地log的管理页面中删除指定的log文件

2017-05-10 change 1、支持腾讯的Xlog框架,仍兼容老版本的log写入,日志管理也统一由xlog来管理 2、去掉对异常的捕获,建议使用第三方比如国内bugly 国外fabric

Latest podspec

{
    "name": "DDLogger",
    "version": "1.3.0",
    "summary": "simple, pretty and powerful logger for iOS with pikeru3001vieweru3001console",
    "homepage": "https://github.com/393385724/DDLogger",
    "license": "MIT",
    "authors": {
        "llg": "[email protected]"
    },
    "source": {
        "git": "https://github.com/393385724/DDLogger.git",
        "tag": "1.3.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": [
        "DDLogger/*.{h,m,mm}",
        "DDLogger/Mars/*.{h,cc}"
    ],
    "public_header_files": "DDLogger/DDLogger.h",
    "ios": {
        "vendored_frameworks": "DDLogger/Mars/*.framework",
        "resources": [
            "DDLogger/*.png",
            "DDLogger/*.xib"
        ]
    },
    "frameworks": [
        "CoreTelephony",
        "SystemConfiguration",
        "Foundation",
        "CoreGraphics",
        "UIKit"
    ],
    "libraries": "z",
    "user_target_xcconfig": {
        "ENABLE_BITCODE": "NO"
    },
    "dependencies": {
        "ICTextView": [
            "~> 2.0.1"
        ]
    }
}

Pin It on Pinterest

Share This