How to install the SDK without CocoaLumberjack? - infobip/mobile-messaging-sdk-ios GitHub Wiki
CocoaLumberjack is used intensively for logging within MobileMessaging SDK. It is a really helpful tool for debugging and we strongly recommend you to leave the default behaviour, at least for development and testing stages.
Note
The CocoaLumberjack logging is enabled by default for release builds and stores logs to the disk. Explore
public protocol MMLogging
for detailed information.
In case you really want to get rid of optional dependencies and consider CocoaLumberjack as a redundant dependency, you can install a Core version of MobileMessaging SDK. In your Podfile
use the following code:
pod 'MobileMessaging/Core'
Going further this way, you can use your own logging tool by implementing the MMLogging
protocol and setting your logger as a MobileMessaging default logger:
class CustomMagicLogger: MMLogging {
var logOutput: MMLogOutput { ... }
var logLevel: MMLogLevel { ... }
var logFilePath: String? { ... }
func sendLogs(fromViewController vc: UIViewController) { ... }
func logDebug(message: String) { ... }
func logInfo(message: String) { ... }
func logError(message: String) { ... }
func logWarn(message: String) { ... }
func logVerbose(message: String) { ... }
}
...
MobileMessaging.logger = CustomMagicLogger()