lumberjack

Immediately flushing log statements using the Cocoa Lumberjack logging framework, the way NSLog flushes to console

∥☆過路亽.° 提交于 2019-12-03 09:04:59
问题 Many iOS developers have found the Cocoa Lumberjack Logging framework to fill a need that simple NSLog statements don't. It's reminiscent of Log4J in the Java world. In any event, I have written my own custom formatter for Lumberjack, but what I don't see is any documentation on how to flush log statements immediately. For example, if I'm walking through the debugger and I hit an NSLog() statement, it flushes the log statement to the console immediately. That's the behavior I'd like to get

Global log level for CocoaLumberjack

核能气质少年 提交于 2019-11-30 10:46:13
问题 I'm using CocoaLumberjack in an iPhone project, to log some information. I've followed the Getting started guide, and everything works fine, but there is one thing that bugs me: there doesn't seem to be an elegant way to define a log level for the whole app. To make it work I need to define a constant in every source file, like this: static const int ddLogLevel = LOG_LEVEL_VERBOSE; So, is there a way to define a global log level for the application? I found this article on the subject, but I

Global log level for CocoaLumberjack

倖福魔咒の 提交于 2019-11-29 21:21:11
I'm using CocoaLumberjack in an iPhone project, to log some information. I've followed the Getting started guide , and everything works fine, but there is one thing that bugs me: there doesn't seem to be an elegant way to define a log level for the whole app. To make it work I need to define a constant in every source file, like this: static const int ddLogLevel = LOG_LEVEL_VERBOSE; So, is there a way to define a global log level for the application? I found this article on the subject, but I still need to add an #import in every file... You could use an #include statement in your *.pch file

CocoaLumberjack with Swift - Calling preprocessor macros

倾然丶 夕夏残阳落幕 提交于 2019-11-28 23:24:57
问题 I started to build an IOS app with the new programming language Swift. I managed to use CocoaPods and was able to successfully create the DDTTYLogger with my CustomLoggerFormatter (Objective-C) in my AppDelegate.swift and append it to the loggers. var customLoggerFormatter = CustomLoggerFormatter() var consoleLogger: DDTTYLogger = DDTTYLogger.sharedInstance() consoleLogger.setLogFormatter(customLoggerFormatter) DDLog.addLogger(consoleLogger) But the problem is, that the CocoaLumberjack