lumberjack

iOS CocoaLumberjack: New log file is creating on every time app launch, if backgroundModes enabled and app running in simulator

安稳与你 提交于 2020-01-06 08:59:48
问题 I have configured library like below let fileLogger: DDFileLogger = DDFileLogger() fileLogger.rollingFrequency = -1 fileLogger.maximumFileSize = 1024 * 1024 fileLogger.logFileManager.maximumNumberOfLogFiles = 7 DDLog.add(fileLogger) File has to roll only if it reaches 1MB size. Recently i observed one thing, if app running in simulator with background mode enabled. New log file is creating on every time app launch irrespective of file size. Is this known thing?. Because NSFileProtectionType

Global import for Swift CocoaLumberjack

放肆的年华 提交于 2019-12-25 08:19:55
问题 I configured CocoaLumberjack properly using the swift pod. And I can log whatever: DDLogVervose("") DDLogInfo("") But I have to in every class to use it: import CocoaLumberjack Isnt there a way that I can globaly import ? 回答1: The only "trick" to have it available in all your classes is to use a pch (precompiled header) and import CocoaLumberjack there. It's a header that gets imported in all your files. 来源: https://stackoverflow.com/questions/40568997/global-import-for-swift-cocoalumberjack

syscall_thread_switch iOS 8.3 race - CocoaLumberjack bug? how to debug this?

百般思念 提交于 2019-12-21 20:08:40
问题 I'm hitting a race-condition in my app, where all or all but 1 threads get stuck on syscall_thread_switch whenever I pause debugging. It reproduces much more often on the simulator, but also on the iPad Air. There is ALWAYS at least 2 threads stuck in CocoaLumberjack's queueLogMessage: -- see screenshots. I've never seen this before on 8.1 and 8.2, but i'm hitting it often on 8.3. I'm not claiming this is an 8.3 bug :) This is a level of complexity i've never had to debug before, so i'm not

Where is Logfile stored using cocoaLumberjack

怎甘沉沦 提交于 2019-12-13 11:34:36
问题 I am Using cocoaLumberjack logging framework for iOS logging. For storing logs in a file I used this code. DDFileLogger* fileLogger = [[DDFileLogger alloc] init]; fileLogger.rollingFrequency = 60 * 60 * 24; fileLogger.logFileManager.maximumNumberOfLogFiles = 7; [DDLog addLogger:fileLogger]; DDLogVerbose(@"hello"); NSLog(@"hihihihihi"); I am unable to find where exactly the logfile generated by this code is stored. Can someone help me with this problem ? 回答1: You can download the log files

syscall_thread_switch iOS 8.3 race - CocoaLumberjack bug? how to debug this?

南笙酒味 提交于 2019-12-04 15:13:32
I'm hitting a race-condition in my app, where all or all but 1 threads get stuck on syscall_thread_switch whenever I pause debugging. It reproduces much more often on the simulator, but also on the iPad Air. There is ALWAYS at least 2 threads stuck in CocoaLumberjack's queueLogMessage: -- see screenshots. I've never seen this before on 8.1 and 8.2, but i'm hitting it often on 8.3. I'm not claiming this is an 8.3 bug :) This is a level of complexity i've never had to debug before, so i'm not sure what to do. I hope I'm providing enough information, please let me know if you need more (please be

Cocoa Lumberjack: how to show file and line number?

跟風遠走 提交于 2019-12-03 14:02:04
问题 I am trying to find a way for Cocoa Lumberjack to show me file and line number. After looking through the docs and some Googling, I found no easy way to do this. Is there any way to do this without adding custom formatter? 回答1: Well, like I said, there is no built-in way. So, I've implemented custom formatter: @interface LineNumberLogFormatter : NSObject<DDLogFormatter> - (NSString *)formatLogMessage:(DDLogMessage *)logMessage; @end @implementation LineNumberLogFormatter - (NSString *

CocoaLumberjack FileLogger logging to multiple files

[亡魂溺海] 提交于 2019-12-03 12:53:12
问题 I am using this CocoaLumberjack framework to log all my messages in Objective-C design. Now I want to log all errors to one file and all other messages to another file. I know I could use formatter to filter this information. I created two DDFileLogger instances in AppDelegate but these two loggers keep writing into the same file. I wonder if there is a way that I could specify the logging destination so that two loggers write to two different files. 回答1: The key to getting this working is to