From: Martin Schwenke Date: Mon, 6 Jun 2022 08:02:31 +0000 (+1000) Subject: ctdb-daemon: Use DEBUG() macro for child logging X-Git-Tag: tevent-0.13.0~407 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e752f841e682cc571006c09249b03d82aea5f8cd;p=thirdparty%2Fsamba.git ctdb-daemon: Use DEBUG() macro for child logging 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 Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Thu Jun 16 13:33:10 UTC 2022 on sn-devel-184 --- diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c index 6fcc0535ddd..1da26b5534c 100644 --- a/ctdb/server/ctdb_logging.c +++ b/ctdb/server/ctdb_logging.c @@ -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)); } /*