summaryrefslogtreecommitdiffstats
path: root/discover/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'discover/log.c')
-rw-r--r--discover/log.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/discover/log.c b/discover/log.c
new file mode 100644
index 0000000..189f31e
--- /dev/null
+++ b/discover/log.c
@@ -0,0 +1,24 @@
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "log.h"
+
+static FILE *logf;
+
+void pb_log(const char *fmt, ...)
+{
+ va_list ap;
+ FILE *stream;
+
+ stream = logf ? logf : stdout;
+
+ va_start(ap, fmt);
+ vfprintf(stream, fmt, ap);
+ va_end(ap);
+}
+
+void pb_log_set_stream(FILE *stream)
+{
+ logf = stream;
+}
OpenPOWER on IntegriCloud