diff options
Diffstat (limited to 'lib/log/log.c')
-rw-r--r-- | lib/log/log.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/log/log.c b/lib/log/log.c new file mode 100644 index 0000000..e006fd0 --- /dev/null +++ b/lib/log/log.c @@ -0,0 +1,23 @@ + +#include <stdarg.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; +} |