From: David Mulder Date: Fri, 23 Aug 2024 15:02:51 +0000 (-0600) Subject: Always print a newline at the end of debug msgs X-Git-Tag: tdb-1.4.13~883 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a60174c04944e26619c8314c670f7f960b4089e;p=thirdparty%2Fsamba.git Always print a newline at the end of debug msgs Otherwise the message doesn't flush to the log and could be lost when the program terminates. Signed-off-by: David Mulder Reviewed-by: Alexander Bokovoy --- diff --git a/rust/dbg/src/lib.rs b/rust/dbg/src/lib.rs index 30b66135811..26c513e2029 100644 --- a/rust/dbg/src/lib.rs +++ b/rust/dbg/src/lib.rs @@ -89,7 +89,9 @@ macro_rules! DBG_PREFIX { let function_msg = format!("{}: ", function); let function_cstr = chelps::wrap_string(&function); let function_msg_cstr = chelps::wrap_string(&function_msg); - let msg = format!($($arg),*); + // Always append a newline to the debug, otherwise it won't flush + // to the log. + let msg = format!("{}\n", format!($($arg),*)); let msg_cstr = chelps::wrap_string(&msg); unsafe { let _ = $crate::ffi::debuglevel_get_class($crate::ffi::DBGC_CLASS as usize) >= ($level as i32)