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(), ignoring LogLevel.debug messages and does not print source details (ie. file, line, function). You can set a new instance of PrintLogger with the levels you desire, or you may implement your own custom Logger 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
    See more

    Declaration

    Swift

    public protocol Logger
  • Describes different types of log messages which can be used to filter which messages are collected.

    See more

    Declaration

    Swift

    public enum LogLevel : String, CaseIterable
  • Default Logger implementation that prints messages to the console.

    See more

    Declaration

    Swift

    public class PrintLogger : Logger