pub trait Logger {
// Required method
fn log_fmt(&mut self, args: Arguments<'_>);
// Provided methods
fn log_bytes(&mut self, label: &str, bytes: &[u8]) { ... }
fn log_i2c(&mut self, context: &str, result: Result<(), impl Debug>) { ... }
fn log_cmd(&mut self, cmd: u8) { ... }
}Expand description
Common logging interface.
Implementors provide a log_fmt() method for formatted output.
Additional helper methods like [log_bytes()], [log_i2c()], and [log_cmd()]
are enabled only when the debug_log feature is active.
Required Methods§
Provided Methods§
Sourcefn log_bytes(&mut self, label: &str, bytes: &[u8])
fn log_bytes(&mut self, label: &str, bytes: &[u8])
Logs a byte slice in 0xXX format with a label.
Truncates output with ... if it exceeds the internal buffer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.