diff options
Diffstat (limited to 'discover/log.c')
-rw-r--r-- | discover/log.c | 24 |
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; +} |