I've been using CocoaLumberjack in Swift and Obj-C for years with pod 'CocoaLumberjack/Swift'.
I'm converting code from Obj-C to Swift and can't figure out how to translate this into Swift:
- (void)functionThatGetsCalledAlot {
if (ddLogLevel & DDLogLevelVerbose) {
DDLogVerbose(@"Log message");
...Many more log statements...
}
}
I only use this in rare performance sensitive cases where I only want to execute some block of code based on the log level. The condition will be true if the dynamic log level, ddLogLevel, includes DDLogLevelVerbose which is true for DDLogLevelVerbose and DDLogLevelAll.
How do I write this in Swift?