Logger

public struct Logger

Simple internal logger for the issues in Zalando Commerce SDK.

Uses 3 basic logging levels:

  • Logger.Severity.debug (default when compiled with$DEBUG)
  • Logger.Severity.message
  • Logger.Severity.error (default in Release mode)
  • Logs a message constructed of items if logging level is Logger.Severity.debug only.

    Declaration

    Swift

    public static func debug(_ items: Any..., verbose: Bool? = nil,
                                 function: String = #function, filePath: String = #file, fileLine: Int = #line)

    Parameters

    items

    items to print out

    verbose

    flag to show details detailed information about function, file and line, where log was called

    function

    function name, where function was called (don’t use it, relies on #function)

    filePath

    file name, where function was called (don’t use it, relies on #file)

    fileLine

    file line number name, where function was called (don’t use it, relies on #line)

  • Logs a message constructed of items if logging level is Logger.Severity.message or Logger.Severity.error.

    Declaration

    Swift

    public static func message(_ items: Any..., verbose: Bool? = nil,
                                   function: String = #function, filePath: String = #file, fileLine: Int = #line)

    Parameters

    items

    items to print out

    verbose

    flag to show details detailed information about function, file and line, where log was called

    function

    function name, where function was called (don’t use it, relies on #function)

    filePath

    file name, where function was called (don’t use it, relies on #file)

    fileLine

    file line number name, where function was called (don’t use it, relies on #line)

  • Logs a message constructed of items if logging level is Logger.Severity.debug, Logger.Severity.message, Logger.Severity.error.

    Declaration

    Swift

    public static func error(_ items: Any..., verbose: Bool? = nil,
                                 function: String = #function, filePath: String = #file, fileLine: Int = #line)

    Parameters

    items

    items to print out

    verbose

    flag to show details detailed information about function, file and line, where log was called

    function

    function name, where function was called (don’t use it, relies on #function)

    filePath

    file name, where function was called (don’t use it, relies on #file)

    fileLine

    file line number name, where function was called (don’t use it, relies on #line)