MqttLogger

interface MqttLogger

Logging interface for MQTTastic library consumers.

Implement this interface to receive log output from the MQTT client. Configure it via MqttConfig.logger along with MqttConfig.logLevel.

Example

val config = MqttConfig(
clientId = "my-client",
logger = MqttLogger.println(),
logLevel = MqttLogLevel.DEBUG,
)

See also

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun log(level: MqttLogLevel, tag: String, message: String, throwable: Throwable? = null)

Called when the library produces a log message at or above the configured level.