sd/milkymist-memcard: Fix format string
[qemu/armbru.git] / tools / virtiofsd / fuse_log.c
blobc301ff6da14526fb8f229aba76295512825fea33
1 /*
2 * FUSE: Filesystem in Userspace
3 * Copyright (C) 2019 Red Hat, Inc.
5 * Logging API.
7 * This program can be distributed under the terms of the GNU LGPLv2.
8 * See the file COPYING.LIB
9 */
11 #include "qemu/osdep.h"
12 #include "fuse_log.h"
14 #include <stdarg.h>
15 #include <stdio.h>
17 static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
18 const char *fmt, va_list ap)
20 vfprintf(stderr, fmt, ap);
23 static fuse_log_func_t log_func = default_log_func;
25 void fuse_set_log_func(fuse_log_func_t func)
27 if (!func) {
28 func = default_log_func;
31 log_func = func;
34 void fuse_log(enum fuse_log_level level, const char *fmt, ...)
36 va_list ap;
38 va_start(ap, fmt);
39 log_func(level, fmt, ap);
40 va_end(ap);