McuMgrLogger
A log emitter used internally by the Mcu Manager library.
Each layer of the library owns an instance of this class, bound to the Category that layer reports under. The sink is assigned by the application, and passed down from one layer to the next; it may be changed at any time, or set to null to stop logging. Log messages are built only when a sink is set.
The formatting methods accept the {} placeholder syntax and, like most logging facades, treat a trailing Throwable that has no matching placeholder as the throwable associated with the entry:
LOG.info("Uploading {} bytes", length);
LOG.error("Upload failed", exception);Content copied to clipboard
From Kotlin, prefer the lambda overloads, which avoid building the message when no sink is set:
LOG.info { "Uploading $length bytes" }Content copied to clipboard