fix multiline issues (but adds a heap alloc :(

This commit is contained in:
Intege-rs
2025-12-02 15:40:11 -05:00
parent 0d6029ace8
commit 6b390511d5
2 changed files with 14 additions and 1 deletions

View File

@@ -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")?;

View File

@@ -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
}