@Polyphonic
Here's a code example illustrating what I mean. In the code below, which of the Cocoalumberjack lines that get logged can be controlled by what level is set in DDLog.add(consoleLogger, with: .warning), if this code is run only two lines of CocoaLumberjack output will be displayed, this can be increased or decreased by changing what is pass to DDLog.add().
My question, is is there an equivalent for the iOS native logging?
let consoleLogger = DDOSLogger.sharedInstance
DDLog.add(consoleLogger, with: .warning)
NSLog("NSLog Cocoalumberjack:")
DDLogVerbose( DDLogVerbose")
DDLogInfo("DDLogInfo")
DDLogDebug("DDLogDebug")
DDLogWarn("DDLogWarn")
DDLogError("DDLogError")
if #available(iOS 14.0, *) {
NSLog("NSLog Native:")
let defaultLog = Logger()
defaultLog.trace("Logger TRACE")
defaultLog.info("Logger INFO")
defaultLog.debug("Logger DEBUG")
defaultLog.notice("Logger NOTICE")
defaultLog.warning("Logger WARNING")
defaultLog.error("Logger ERROR")
}
Topic:
App & System Services
SubTopic:
Core OS
Tags: