summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-07-09 11:24:21 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-07-09 17:36:17 +0200
commit6b57784f0f175275fd900eca21c77415e3a5ea52 (patch)
treed84f5e07346aa1a452a3b9148719dacd79b08164 /src/util
parent9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a (diff)
downloadsssd-6b57784f0f175275fd900eca21c77415e3a5ea52.tar.gz
sssd-6b57784f0f175275fd900eca21c77415e3a5ea52.tar.xz
sssd-6b57784f0f175275fd900eca21c77415e3a5ea52.zip
TOOLS: Always debug to stderr
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 <mzidek@redhat.com>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/util.h8
1 files changed, 8 insertions, 0 deletions
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__)