]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Always print a newline at the end of debug msgs
authorDavid Mulder <dmulder@samba.org>
Fri, 23 Aug 2024 15:02:51 +0000 (09:02 -0600)
committerDavid Mulder <dmulder@samba.org>
Wed, 23 Oct 2024 14:21:34 +0000 (14:21 +0000)
Otherwise the message doesn't flush to the log
and could be lost when the program terminates.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
rust/dbg/src/lib.rs

index 30b661358115c51013fb278e1192b1f65a53e456..26c513e20299aca6a9a5f68678998f8a653253ae 100644 (file)
@@ -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)