The FMPLog.Builder class is a builder for the FMPLog class.
class Builder
Method | Description |
level(_:) |
Save logging level to variable. func level(_ level: FMPLog.Level) -> Builder Parameters:
|
outputType(_:) | Save log record type to variable. func outputType(_ outputType: FMPLog.OutputType) -> Builder Parameters:
|
database(_:) | Save object of the database, with which FMPLog will work, to variable. func database(_ database: FMPDatabase) -> Builder Parameters:
|
databaseLimit(_:) | Save the maximum number of log records in database to variable. func databaseLimit(_ limit: Int32?) -> Builder Parameters:
|
isEnabled(_:) | It sets displaying of framework logs in the console. func isEnabled(_ isEnabled: Bool = true) -> Builder Parameters:
|
isSecure(_:) | It sets writing of secure data to log. func isSecure(_ isSecure: Bool = true) -> Builder Parameters:
|
build() | Build an instance of the FMPLog class. It returns the object of the FMPLog type. func build() -> FMPLog |
Build an instance of the FMPLog class:
// Build an instance of the FMPDatabase class. For details see examples for FMPDatabase.Builder.
let logDatabase: FMPDatabase = fmp.database.build()
// Build an instance of the FMPLog class with various settings
let log: FMPLog = fmp.log
.database(logDatabase) // By default FMPDatabase(path: "", key: "")
.databaseLimit(1000) // By default nil
.isEnabled(true) // By default false
.isSecure(false) // By default true
.level(.database) // By default .verbose
.outputType(.database) // By default .none
.build()
See also: