Logger
public class Logger
Important
This is a Public Preview API. It may be changed or removed at any time.-
Inits the
Loggerwith default outputs:ConsoleOutputandFileOutput. File logs are stored for 2 weeks, after that being deleted.Declaration
Swift
public convenience init() -
Inits the
Loggerwith provided log outputs.Declaration
Swift
public init(outputs: [LoggerOutput])Parameters
outputsThe array of user defined
LoggerOutputs
-
Desired log level, default is
.verboseDeclaration
Swift
public var logLevel: LogLevel -
Returns all available log’s file
Declaration
Swift
public func logURLs() -> [URL] -
Logs a message with an info level
Declaration
Swift
public func info(file: String = #file, line: Int = #line, column: Int = #column, function: String = #function)Parameters
itemsThe items to log.
fileThe file in which the log happens.
lineThe line at which the log happens.
columnThe column at which the log happens.
functionThe function in which the log happens.
-
Logs a message with an info level
Declaration
Swift
public func info( _ items: Any..., file: String = #file, line: Int = #line, column: Int = #column, function: String = #function )Parameters
itemsThe items to log.
fileThe file in which the log happens.
lineThe line at which the log happens.
columnThe column at which the log happens.
functionThe function in which the log happens.
-
Logs a message with an info level
Declaration
Swift
public func verbose(file: String = #file, line: Int = #line, column: Int = #column, function: String = #function)Parameters
itemsThe items to log.
fileThe file in which the log happens.
lineThe line at which the log happens.
columnThe column at which the log happens.
functionThe function in which the log happens.
-
Logs a message with an verbose level
Declaration
Swift
public func verbose( _ items: Any..., file: String = #file, line: Int = #line, column: Int = #column, function: String = #function )Parameters
itemsThe items to log.
fileThe file in which the log happens.
lineThe line at which the log happens.
columnThe column at which the log happens.
functionThe function in which the log happens.
-
Logs a message with an warning level
Declaration
Swift
public func warning( _ items: Any..., file: String = #file, line: Int = #line, column: Int = #column, function: String = #function )Parameters
itemsThe items to log.
fileThe file in which the log happens.
lineThe line at which the log happens.
columnThe column at which the log happens.
functionThe function in which the log happens.
-
Logs a message with an error level
Declaration
Swift
public func error( _ items: Any..., file: String = #file, line: Int = #line, column: Int = #column, function: String = #function )Parameters
itemsThe items to log.
fileThe file in which the log happens.
lineThe line at which the log happens.
columnThe column at which the log happens.
functionThe function in which the log happens.
Logger Class Reference