DefaultLogger

public final class DefaultLogger : CoreStoreLogger

The DefaultLogger is a basic implementation of the CoreStoreLogger protocol.

  • Creates a DefaultLogger.

    Declaration

    Swift

    public init()
  • Handles log messages sent by the CoreStore framework.

    Declaration

    Swift

    public func log(level: LogLevel, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)

    Parameters

    level

    the severity of the log message

    message

    the log message

    fileName

    the source file name

    lineNumber

    the source line number

    functionName

    the source function name

  • Handles errors sent by the CoreStore framework.

    Declaration

    Swift

    public func log(error: CoreStoreError, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)

    Parameters

    error

    the error

    message

    the error message

    fileName

    the source file name

    lineNumber

    the source line number

    functionName

    the source function name

  • Handles assertions made throughout the CoreStore framework.

    Declaration

    Swift

    public func assert(_ condition: @autoclosure () -> Bool, message: @autoclosure () -> String, fileName: StaticString, lineNumber: Int, functionName: StaticString)

    Parameters

    message

    the assertion message

    fileName

    the source file name

    lineNumber

    the source line number

    functionName

    the source function name

  • Handles fatal errors made throughout the CoreStore framework.

    Important

    Implementers should guarantee that this function doesn’t return, either by calling another Never function such as fatalError() or abort(), or by raising an exception.

    Declaration

    Swift

    public func abort(_ message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)

    Parameters

    message

    the fatal error message

    fileName

    the source file name

    lineNumber

    the source line number

    functionName

    the source function name