lib/util: add debug_set_forced_log_priority()
authorStefan Metzmacher <metze@samba.org>
Wed, 22 Nov 2023 16:03:30 +0000 (17:03 +0100)
committerJule Anger <janger@samba.org>
Tue, 19 Dec 2023 09:43:09 +0000 (09:43 +0000)
commit98d794260222c287c187d38bc57f9f836e4923ab
treef61a71ae6ee2e58bb2f14c8b5ec3465c8258b2ef
parent928dfe6e94d71018fc53136d03028143af65dab2
lib/util: add debug_set_forced_log_priority()

By default the priority for syslog/systemd is derived from
the log level of the debug message.

But for things like startup messages we want to
change the priority temporary, like this:

debug_set_forced_log_priority(DBGLVL_NOTICE);
D_ERR("Startup...\n");
debug_set_forced_log_priority(-1);

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit bd21a0cdefb30ef5522f81d865c03d11a182a63c)
lib/util/debug.c
lib/util/debug.h