CoreStoreLogger
public protocol CoreStoreLogger
Custom loggers should implement the CoreStoreLogger protocol and pass its instance to CoreStoreDefaults.logger. Calls to log(...), assert(...), and abort(...) are not tied to a specific queue/thread, so it is the implementer’s job to handle thread-safety.
-
Handles log messages sent by the
CoreStoreframework.Declaration
Swift
func log(level: LogLevel, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)Parameters
levelthe severity of the log message
messagethe log message
fileNamethe source file name
lineNumberthe source line number
functionNamethe source function name
-
Handles errors sent by the
CoreStoreframework.Declaration
Swift
func log(error: CoreStoreError, message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)Parameters
errorthe error
messagethe error message
fileNamethe source file name
lineNumberthe source line number
functionNamethe source function name
-
Handles assertions made throughout the
CoreStoreframework.Declaration
Swift
func assert(_ condition: @autoclosure () -> Bool, message: @autoclosure () -> String, fileName: StaticString, lineNumber: Int, functionName: StaticString)Parameters
conditionthe assertion condition
messagethe assertion message
fileNamethe source file name
lineNumberthe source line number
functionNamethe source function name
-
abort(_:Default implementationfileName: lineNumber: functionName: ) Handles fatal errors made throughout the
CoreStoreframework. The app wil terminate after this method is called.Important
Implementers may guarantee that the function doesn’t return, either by calling another
Neverfunction such asfatalError()orabort(), or by raising an exception. If the implementation does not terminate the app, CoreStore will call an internalfatalError()to do so.Default Implementation
Declaration
Swift
func abort(_ message: String, fileName: StaticString, lineNumber: Int, functionName: StaticString)Parameters
messagethe fatal error message
fileNamethe source file name
lineNumberthe source line number
functionNamethe source function name
View on GitHub
CoreStoreLogger Protocol Reference