aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2019-09-10 12:36:56 +0200
committerNikolaus Rath <Nikolaus@rath.org>2019-09-10 14:25:15 +0100
commitd368dad2c8d34bc37d76ef36f79a463c12f933ff (patch)
tree40e5f938ccbf74be12e766047ae07862182e654f
parent7c1e09dbc2e4215969425e50ec03889d19a926d4 (diff)
downloadlibfuse-d368dad2c8d34bc37d76ef36f79a463c12f933ff.tar.gz
log: move fuse_log() to the public header file
Applications may wish to call fuse_log() for unified logging. This way they don't need to define their own wrappers to invoke the log message handler function installed by fuse_set_log_func(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--include/fuse_log.h8
-rw-r--r--lib/fuse_i.h2
-rw-r--r--lib/fuse_log.c1
-rw-r--r--lib/fuse_versionscript6
4 files changed, 14 insertions, 3 deletions
diff --git a/include/fuse_log.h b/include/fuse_log.h
index df43697..5e112e0 100644
--- a/include/fuse_log.h
+++ b/include/fuse_log.h
@@ -67,6 +67,14 @@ typedef void (*fuse_log_func_t)(enum fuse_log_level level,
*/
void fuse_set_log_func(fuse_log_func_t func);
+/**
+ * Emit a log message
+ *
+ * @param level severity level (FUSE_LOG_ERR, FUSE_LOG_DEBUG, etc)
+ * @param fmt sprintf-style format string including newline
+ */
+void fuse_log(enum fuse_log_level level, const char *fmt, ...);
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/fuse_i.h b/lib/fuse_i.h
index 4883ef6..d38b630 100644
--- a/lib/fuse_i.h
+++ b/lib/fuse_i.h
@@ -131,8 +131,6 @@ struct fuse *fuse_new_31(struct fuse_args *args, const struct fuse_operations *o
int fuse_loop_mt_32(struct fuse *f, struct fuse_loop_config *config);
int fuse_session_loop_mt_32(struct fuse_session *se, struct fuse_loop_config *config);
-void fuse_log(enum fuse_log_level level, const char *fmt, ...);
-
#define FUSE_MAX_MAX_PAGES 256
#define FUSE_DEFAULT_MAX_PAGES_PER_REQ 32
diff --git a/lib/fuse_log.c b/lib/fuse_log.c
index 09178e4..0d268ab 100644
--- a/lib/fuse_log.c
+++ b/lib/fuse_log.c
@@ -9,7 +9,6 @@
*/
#include "fuse_log.h"
-#include "fuse_i.h"
#include <stdarg.h>
#include <stdio.h>
diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript
index 00f955d..11ef1f7 100644
--- a/lib/fuse_versionscript
+++ b/lib/fuse_versionscript
@@ -159,6 +159,12 @@ FUSE_3.4 {
fuse_reply_copy_file_range;
} FUSE_3.3;
+FUSE_3.7 {
+ global:
+ fuse_set_log_func;
+ fuse_log;
+} FUSE_3.3;
+
# Local Variables:
# indent-tabs-mode: t
# End: