]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-daemon: Use DEBUG() macro for child logging
authorMartin Schwenke <martin@meltin.net>
Mon, 6 Jun 2022 08:02:31 +0000 (18:02 +1000)
committerVolker Lendecke <vl@samba.org>
Thu, 16 Jun 2022 13:33:10 +0000 (13:33 +0000)
Directly using dbgtext() with file logging results in a log entry with
no header, which is wrong.  This is a regression, introduced in commit
10d15c9e5dfe4e8595d0b322c96f474fc7078f46.  Prior to this, CTDB's
callback for file logging would always add a header.

Use DEBUG() instead dbgtext().  Note that DEBUG() effectively compares
the passed script_log_level with DEBUGLEVEL, so an explicit check is
no longer necessary.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15090

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jun 16 13:33:10 UTC 2022 on sn-devel-184

ctdb/server/ctdb_logging.c

index 6fcc0535ddd747a0f4ddbac0d0e1e222a1c0c8b1..1da26b5534c76e05d28b263e691439e70fd51d82 100644 (file)
@@ -67,9 +67,7 @@ bool ctdb_logging_init(TALLOC_CTX *mem_ctx, const char *logging,
 
 static void write_to_log(const char *buf, unsigned int len)
 {
-       if (script_log_level <= DEBUGLEVEL) {
-               dbgtext("%*.*s\n", len, len, buf);
-       }
+       DEBUG(script_log_level, ("%*.*s\n", len, len, buf));
 }
 
 /*