From 6b390511d50d558f19ab60120df8d8071474474c Mon Sep 17 00:00:00 2001 From: Intege-rs Date: Tue, 2 Dec 2025 15:40:11 -0500 Subject: [PATCH] fix multiline issues (but adds a heap alloc :( --- src/lib.rs | 2 +- src/main.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 27e906c..db7ffc5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -71,7 +71,7 @@ fn format(record: &Record) -> std::io::Result<()> { // write the actual message use std::fmt::Write; let mut splicer = LineSplicer(buffer); - _=write!(splicer, "{}", record.args()); + _=write!(splicer, "{}", record.args().to_string()); // finalize write!(buffer, "\n")?; diff --git a/src/main.rs b/src/main.rs index eb93be6..82f0f2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,4 +11,17 @@ fn main() { info!("multiline\ndemo"); info!("one\ntwo\nthree\nfour"); + info!("{:#?}", &Test { + string: "Hello World!".to_string(), + test: 0x13412312, + test2: 0xAA, + }); + +} + +#[derive(Debug)] +struct Test { + string: String, + test: u64, + test2: u8 } \ No newline at end of file