From 8da61292f595c5e700a4fef981b0e0d07910b4b2 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 30 Apr 2015 19:51:49 +0200 Subject: Provide an interface for logging debug messages --- pcilib/debug.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pcilib/debug.c (limited to 'pcilib/debug.c') diff --git a/pcilib/debug.c b/pcilib/debug.c new file mode 100644 index 0000000..f07e1e6 --- /dev/null +++ b/pcilib/debug.c @@ -0,0 +1,16 @@ +#include +#include +#include + +#include "error.h" + +void pcilib_debug_message(const char *function, const char *file, int line, const char *format, ...) { + va_list va; + + if (!getenv(function)) return; + + va_start(va, format); + pcilib_log_vmessage(file, line, PCILIB_LOG_DEBUG, format, va); + va_end(va); +} + -- cgit v1.2.3