2025-03-09 20:33:21 -06:00

19 lines
368 B
Rust

use crate::medium::WriteMedium;
use log::info;
pub struct Logger;
impl std::io::Write for Logger {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
info!("Outbound Message: {}", pretty_hex::pretty_hex(&buf));
Ok(buf.len())
}
fn flush(&mut self) -> std::io::Result<()> {
Ok(())
}
}
impl WriteMedium for Logger {}