summaryrefslogtreecommitdiffstats
path: root/src/util/debug.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2013-12-20 15:17:19 -0500
committerJakub Hrozek <jhrozek@redhat.com>2014-02-19 12:28:05 +0100
commit41354b0b972df187d5b6f6b02b26b736ec6bce23 (patch)
tree25ffaf771fde8194dd31193fd56b4a175572de80 /src/util/debug.c
parenta37bd3e4ad3e65c7011f29384f54aa15ac3311aa (diff)
downloadsssd-41354b0b972df187d5b6f6b02b26b736ec6bce23.tar.gz
sssd-41354b0b972df187d5b6f6b02b26b736ec6bce23.tar.xz
sssd-41354b0b972df187d5b6f6b02b26b736ec6bce23.zip
DEBUG: Allow debug_fn to process __FILE__ and __LINE__
In preparation for enabling journald support for the DEBUG logs, we will need to be able to pass in certain additional arguments that will be required, specifically the code file and line number. We will be able to optionally enable this in the file-based logs as well if we so choose, but for right now we will avoid breaking the log format on disk. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/util/debug.c')
-rw-r--r--src/util/debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/util/debug.c b/src/util/debug.c
index 6ac916573..3643c2b32 100644
--- a/src/util/debug.c
+++ b/src/util/debug.c
@@ -129,7 +129,11 @@ static void debug_printf(const char *format, ...)
va_end(ap);
}
-void debug_fn(const char *function, int level, const char *format, ...)
+void debug_fn(const char *file,
+ long line,
+ const char *function,
+ int level,
+ const char *format, ...)
{
va_list ap;
struct timeval tv;
@@ -194,7 +198,7 @@ void ldb_debug_messages(void *context, enum ldb_debug_level level,
}
if (DEBUG_IS_SET(loglevel))
- debug_fn("ldb", loglevel, "%s\n", message);
+ debug_fn(__FILE__, __LINE__, "ldb", loglevel, "%s\n", message);
free(message);
}