Console Logs
Appelium logs are similar to NSLog() and print(), but they have the added benefit of having different verbosity levels and can have associated domains. This lets you filter logs better when analyzing them in the Appelium dashboard.
Use Appelium logs through the following methods:
AppeliumFeedback.logVerbose("Verbose statement")
AppeliumFeedback.logInfo("Info statement")
AppeliumFeedback.logWarning("Warning statement")
AppeliumFeedback.logDebug("Debug statement")
AppeliumFeedback.logError("Error statement")
All the log levels allow you to pass an optional domain for even better granularity:
AppeliumFeedback.logError("Transaction failed", domain: "Payment")
CocoaLumberjack
Already using CocoaLumberjack for logging? Great! Appelium provides an extension that allows you to simply route all your logging calls to it without changing a lot of code.
You can integrate it using Carthage:
binary "https://api.appelium.com/v1/sdkArchives/AppeliumCocoaLumberjack.json"
Once you have integrated it, import the AppeliumCocoaLumberjack.framework into your project and enable logging:
DDLog.add(DDAppeliumLogger.sharedInstance())
XCGLogger
Already using XCGLogger for logging? Great! Appelium provides a XCGLogger logging destination which allows you to simply route all your logging calls to it without changing a lot of code.
You can integrate it using Carthage:
binary "https://api.appelium.com/v1/sdkArchives/AppeliumXCGLogger.json"
Once you have integrated it, import the AppeliumXCGLogger.framework into your project and enable logging:
let appeliumLogDestination = AppeliumLogDestination()
XCGLogger.default.add(destination: appeliumLog)