ConsoleLogger

A logger implementation that logs messages to the console.

A logger implementation that logs messages to the console.

Parameters

ParameterTypeDescription
filterBaseLoggerThe log level filter for the logger.

Constructors

Public ConstructorSyntax
ConsoleLoggerconstructor(filter: LogLevel)

Properties

PropertiesSyntax
filteropen override val filter: LogLevel

Parameter

ParameterTypeDescription
filterLogLevelThe log level filter for the logger.

Functions

MethodDescription
logLogs a message to the console.
shouldLogDetermines whether the logger should log a message based on the log level.

log

Logs a message to the console.

Syntax: open override fun log(level: LogLevel, tag: String?, msg: String?, tr: Throwable?)

Parameters

ParametersTypeDescription
levelLogLevelThe log level of the message.
tagStringThe tag for the log message.
msgStringThe log message.
trThrowableThe optional throwable is associated with the log message.

shouldLog

Determines whether the logger should log a message based on the log level.

Syntax: open override fun shouldLog(level: LogLevel): Boolean

Return Value: True if the logger should log the message, false otherwise.

Parameters

ParameterTypeDescription
levelLogLevelThe log level to check.