首页 > 代码库 > CocoaLumberjack

CocoaLumberjack

static constint ddLogLevel =DDLogLevelWarning;


-(void)setUpLumberJack

{

    NSArray  *paths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);

    NSString *docPath = [[pathslastObject]stringByAppendingString:@"/Logs"];

    DDLogFileManagerDefault* fileManager = [[DDLogFileManagerDefaultalloc]initWithLogsDirectory:docPathdefaultFileProtectionLevel:NSFileProtectionNone];

    DDFileLogger* fileLogger = [[DDFileLoggeralloc]initWithLogFileManager:fileManager];

    

    [DDLogaddLogger:[DDASLLoggersharedInstance]];

    [DDLogaddLogger:[DDTTYLoggersharedInstance]];

    [DDLogaddLogger:fileLogger];

}

CocoaLumberjack