summaryrefslogtreecommitdiffstats
path: root/src/util/debug.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-07-08 15:05:24 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-07-09 17:36:08 +0200
commit9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a (patch)
tree05da2bdd23b7c8834338a7d72ce5b302c46bc386 /src/util/debug.c
parent842f83f8db513214241a0fea076ac160b180e1dd (diff)
downloadsssd-9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a.tar.gz
sssd-9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a.tar.xz
sssd-9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a.zip
SSSD: Send debug to stderr when running on foreground
https://fedorahosted.org/sssd/ticket/2348 When SSSD is running in interactive mode, we should print DEBUG messages directly to stderr, not journal. Reviewed-by: Michal Židek <mzidek@redhat.com>
Diffstat (limited to 'src/util/debug.c')
-rw-r--r--src/util/debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/debug.c b/src/util/debug.c
index b66de07b4..a99d5403a 100644
--- a/src/util/debug.c
+++ b/src/util/debug.c
@@ -42,6 +42,7 @@ int debug_level = SSSDBG_UNRESOLVED;
int debug_timestamps = SSSDBG_TIMESTAMP_UNRESOLVED;
int debug_microseconds = SSSDBG_MICROSECONDS_UNRESOLVED;
int debug_to_file = 0;
+int debug_to_stderr = 0;
const char *debug_log_file = "sssd";
FILE *debug_file = NULL;
@@ -212,7 +213,7 @@ void debug_fn(const char *file,
errno_t ret;
va_list ap_fallback;
- if (!debug_file) {
+ if (!debug_file && !debug_to_stderr) {
/* If we are not outputting logs to files, we should be sending them
* to journald.
* NOTE: on modern systems, this is where stdout/stderr will end up