log: move fuse_log() to the public header file
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 10 Sep 2019 10:36:56 +0000 (12:36 +0200)
committerNikolaus Rath <Nikolaus@rath.org>
Tue, 10 Sep 2019 13:25:15 +0000 (14:25 +0100)
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>
include/fuse_log.h
lib/fuse_i.h
lib/fuse_log.c
lib/fuse_versionscript

index df43697b05f4d34c929932a4d273a6f1c147e835..5e112e0f5343c7f8e2e75160c8e60bccd3b8037e 100644 (file)
@@ -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
index 4883ef64c5cf38a302872c0b1f4c65a0ab6d9ee9..d38b630ac5fc94c52cc69db469e5349e7311a499 100644 (file)
@@ -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
 
index 09178e43afe7e1ba37f2756100af998d54a579b6..0d268ab014f5c863b6fdd76d30d0a6002c131d79 100644 (file)
@@ -9,7 +9,6 @@
 */
 
 #include "fuse_log.h"
-#include "fuse_i.h"
 
 #include <stdarg.h>
 #include <stdio.h>
index 00f955d516ef374d7e632af65c4c5f90c62505ea..11ef1f7ebb210d157412f960ae424f09675834b3 100644 (file)
@@ -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: