From 6b57784f0f175275fd900eca21c77415e3a5ea52 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 9 Jul 2014 11:24:21 +0200 Subject: TOOLS: Always debug to stderr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://fedorahosted.org/sssd/ticket/2348 Programs that are supposed to only be executed on the foreground should log to stderr automatically. Reviewed-by: Michal Židek --- src/util/util.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/util') diff --git a/src/util/util.h b/src/util/util.h index 6a9bc0c2e..b605f230a 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -152,6 +152,14 @@ errno_t set_debug_file_from_fd(const int fd); talloc_set_log_fn(talloc_log_fn); \ } while (0) +/* CLI tools shall debug to stderr even when SSSD was compiled with journald + * support + */ +#define DEBUG_CLI_INIT(dbg_lvl) do { \ + DEBUG_INIT(dbg_lvl); \ + debug_to_stderr = 1; \ +} while (0) + #define PRINT(fmt, ...) fprintf(stdout, gettext(fmt), ##__VA_ARGS__) #define ERROR(fmt, ...) fprintf(stderr, gettext(fmt), ##__VA_ARGS__) -- cgit