Logger
Logs for one tag. Obtain one from a LoggerFactory, or from KcoapLogging.logger for the global configuration.
Messages are lambdas, so nothing is formatted unless the level is enabled:
log.debug { "Retransmitting MID $mid, attempt $attempt" }
log.warn(error) { "Dropped a message from $peer" }Content copied to clipboard
with returns a logger that adds fields to every record, which keeps per-exchange context out of the message text and easy to filter on.
Properties
Functions
Link copied to clipboard
Renders message bytes for a log line: hex when LogConfig.payloadDumps is on, otherwise only the length. Never pass key material here.