Logging
-
Sets the global
Logger
instance used by all code in Jacquard SDK.You do not need to set this - the default logger prints log messages to the console using
print()
, ignoringLogLevel.debug
messages and does not print source details (ie. file, line, function). You can set a new instance ofPrintLogger
with the levels you desire, or you may implement your own customLogger
type.Important
This var is accessed from multiple threads and is not protected with a lock. You can alter this only prior to accessing any Jacquard SDK APIs for the first time in your code.
Declaration
Swift
public func setGlobalJacquardSDKLogger(_ logger: Logger)
Parameters
logger
new
Logger
instance. -
Describes the type you must implement if you wish to provide your own logging implementation.
The only required function to implement is
Logger.log(level:message:)
as the rest have default implementations.See also
jqLogger
Declaration
Swift
public protocol Logger
-
Describes different types of log messages which can be used to filter which messages are collected.
See moreDeclaration
Swift
public enum LogLevel : String, CaseIterable