开发者

CocoaLumberjack file and console different verbosity

开发者 https://www.devze.com 2023-04-02 07:56 出处:网络
I\'m currently using the CocoaLumberjack framework for cocoa/touch applications and it\'s very good. Does anyone know the simplest way to tell the file logger to use sa开发者_运维问答y \"Verbose\" log

I'm currently using the CocoaLumberjack framework for cocoa/touch applications and it's very good. Does anyone know the simplest way to tell the file logger to use sa开发者_运维问答y "Verbose" log level and the console logger to use "Info" or "Warn". This would effectively generate detailed files in the event of something going wrong but not fill up a release version's console.


You can force a specific log level for each logger. We use two additional loggers with different log levels.

DDFileLogger* fileLogger = [[DDFileLogger alloc] init];
fileLogger.rollingFrequency = 60 * 60 * 24; // every 24 hours
fileLogger.logFileManager.maximumNumberOfLogFiles = 7; // roll everyday and keep 7 days worth.


[DDLog addLogger:fileLogger withLevel:DDLogLevelVerbose];
[DDLog addLogger:paperTrailLogger withLevel:DDLogLevelError];
[DDLog addLogger:[DDTTYLogger sharedInstance] withLevel:DDLogLevelVerbose];
0

精彩评论

暂无评论...
验证码 换一张
取 消