util: Avoid logging to multiple backends for stdout/stderr
commitfb774d5d4257fde3a3ff8052434c79e219ecdce4
authorMartin Schwenke <mschwenke@ddn.com>
Wed, 26 Jul 2023 10:43:37 +0000 (26 20:43 +1000)
committerJule Anger <janger@samba.org>
Mon, 28 Aug 2023 09:36:36 +0000 (28 09:36 +0000)
treead6c00bd99744f2415d39edafd9ab27f0785f143
parent645fc88b65cfa27bf5be88b7b485c273ae0d832b
util: Avoid logging to multiple backends for stdout/stderr

Commit 83fe7a0316d3e5867a56cfdc51ec17f36ea03889 converted the
stdout/stderr logging  types to DEBUG_FILE to get a header when using
DEBUG_SYSLOG_FORMAT_ALWAYS.  However, this causes all configured
backends to be invoked.  When syslog is one of those backends then
this is almost certainly not what is intended.

Instead, call debug_file_log() directly in that special case and
revert the parts of the above commit that convert to file logging.

Most of the changes to debughdrclass() still seem necessary, since
they handle the change of debug_syslog_format from a bool to an enum.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Aug 28 01:21:07 UTC 2023 on atb-devel-224

(cherry picked from commit c7672779128ff12eb7a5cb34052559e62adbd5cb)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Mon Aug 28 09:36:36 UTC 2023 on atb-devel-224
lib/util/debug.c