Log
-
A class that wraps a log handling closure. This is needed to be able to store the handler in a weakly referenced
See moreNSHashTable.Declaration
Swift
@objc public class LogHandler: NSObject -
The LogService class allows the client app to control how log messages generated by the libraries are handled.
Messages are logged via the LogVerbose, Log, LogWarning, and LogError functions and the app can control each of these independently by adding event handlers to the appropriate events. The app can also control which events are emitted with the verbosity property.
Note: By default if no log handlers are registered then nothing will be logged. The app can register log handling functions and change the verbosity level at any time but it is recommended to do so as early as possible or some logs could be missed.
Example: Initializing the log service in the AppDelegate
See morelet logHandler = LogHandler({ (item: Any) -> Void in print(item) }) func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. LogService.verbosity = LogService.LogLevel.Verbose LogService.addLogVerboseHandler(logHandler) LogService.addLogHandler(logHandler) LogService.addLogWarningHandler(logHandler) LogService.addLogErrorHandler(logHandler) return true }Declaration
Swift
@objc public class LogService: NSObject
Log Reference