LogKit

作者: WhatHurtsMore | 来源:发表于2018-10-16 14:10 被阅读260次

    LogKit

    Log framework based on CocoaLumberjack and ZipArchive

    Features

    • Easy to test and collect problems that are difficult to reproduce,we can send logs to mailBox without Xcode
    • Output different log information with corresponding colors in the Xcode console or iPhone depending on the log level(Xcode console requiredXcodeColors plug-in)

    Preview

    assistiveButton debugView logMail XcodeConsole
    en_1.png en_2.png xcode_console.png

    Usage

        DLogTrace();            // ouput current function
        
        DLogVerbose(@"");       // ouput verbose level log message
        
        DLogDebug(@"");     //  ouput debug level log message
        
        DLogInfo(@"");      //  ouput info level log message
        
        DLogWarn(@"");      //  ouput warn level log message
        
        DLogError(@"");     //  ouput error level log message
    

    Configuration

    Configuration Settings in project's AppDelegate.m

     // #import 'LogKit.h' 
     // #import <LogKit.h>
     
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        [LogKit addTTYLogger];      // Configure and add a DDTTYLogger (Apple System Log and Xcode console)
        
        [LogKit addFileLogger];     // Send the log to the file (default for non debug builds),requied this method if you want send log files to mail
        
    #ifdef DEBUG
        [LogKit addDashboardLogger];        //  Configure and add a recorder with console logs
    #endif
        
        [LogKit setDefaultMailAddress:@[@"testMailAddress@gmail.com"]];     // Sets the mailbox collection that receives log files (default is empty)
        
        [LogKit setDefaultLogPassword:@"101001"];       // Set the password for the log file (default is empty)
        
        return YES;
    }
    

    Installation

    source 'https://github.com/CocoaPods/Specs.git'
    
    pod 'CocoaLogKit'
    // pod 'CocoaLumberjack'
    // pod 'SSZipArchive'
    

    License

    LogKituse MIT license

    相关文章

      网友评论

          本文标题:LogKit

          本文链接:https://www.haomeiwen.com/subject/opkhzftx.html