KermitCouchbaseLiteLogger

class KermitCouchbaseLiteLogger(kermit: Logger, val level: LogLevel = LogLevel.WARNING) : Logger(source)

Couchbase Lite custom Logger that logs to Kermit

Disable default console logs and set as custom logger:

Database.log.console.level = LogLevel.NONE
Database.log.custom = KermitCouchbaseLiteLogger(kermit)

Note Couchbase Lite LogLevel.DEBUG is lower than LogLevel.VERBOSE, while Kermit Severity.Verbose is lower than Severity.Debug. LogLevel.Verbose still maps to Severity.Verbose and LogLevel.DEBUG to Severity.Debug for consistency reading log prefixes. But these logs will filter differently based on the level filter in this class and Kermit's own minSeverity filter. Since LogLevel.DEBUG logs are only logged in debug builds of Couchbase Lite, this generally isn't an issue.

Constructors

Link copied to clipboard
constructor(kermit: Logger, level: LogLevel = LogLevel.WARNING)

Properties

Link copied to clipboard

The domains that will be considered for writing to the console log.

Link copied to clipboard
open override val level: LogLevel

Functions

Link copied to clipboard
open override fun log(level: LogLevel, domain: LogDomain, message: String)
Link copied to clipboard
fun setDomains(vararg domains: LogDomain)

Sets the domains that will be considered for writing to the console log.