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)
Content copied to clipboard
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.