Latest 2.0.6
Homepage https://github.com/393385724/HMLogger
License MIT
Platforms ios 8.0, requires ARC
Dependencies ICTextView, CocoaLumberjack
Frameworks CoreTelephony, SystemConfiguration, Foundation, CoreGraphics, UIKit
Authors

DDLogger

a log redirect to file ,采用CocoaLumberjackXlog的简单封装,在这里感谢两个开源框架

工程中有解码脚本使用方法如下:
python 脚本路径/decode_mars_log_file.py 日志路径/日志名字.xlog

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

开始收集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];
    [[HMLogger Logger] startLogWithCacheDirectory:docDir nameprefix:@"hm" encrypt:NO];

    return YES;

}

@endcode

当前是否显示logView

  • (BOOL)isShowLogView;

显示logView

  • (void)showLogView;

隐藏logView

  • (void)hidenLogView;

查看本地存在的log日志

@param viewController 当前的Viewontroller

@param handler 选取回调结果

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

Latest podspec

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

Pin It on Pinterest

Share This