debug: ensure that __dprint() is also logged over the network
authorJens Axboe <axboe@kernel.dk>
Wed, 11 Sep 2013 14:23:45 +0000 (08:23 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 11 Sep 2013 14:23:45 +0000 (08:23 -0600)
We force local logging now, but that's not terribly useful
if you can't see the output from the backend. Make it follow
the usual rules of logging over the network if a backend, to
syslog, or locally.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
debug.c
log.c
log.h

diff --git a/debug.c b/debug.c
index 5e9806335fc630e01da4f8a55c5ed042dd939488..013cd53c214debe2cbb7be1ca8842c436390ff96 100644 (file)
--- a/debug.c
+++ b/debug.c
@@ -16,8 +16,8 @@ void __dprint(int type, const char *str, ...)
            && pid != *fio_debug_jobp)
                return;
 
-       log_local("%-8s ", debug_levels[type].name);
-       log_local("%-5u ", (int) pid);
+       log_info("%-8s ", debug_levels[type].name);
+       log_info("%-5u ", (int) pid);
 
        va_start(args, str);
        log_valist(str, args);
diff --git a/log.c b/log.c
index 4822c33526d29fd4b7d9c0731f5030c75c982909..a05a7ec5d3f28f2bc2fd67b08fa8afc132585da4 100644 (file)
--- a/log.c
+++ b/log.c
@@ -14,6 +14,8 @@ int log_valist(const char *str, va_list args)
        len = vsnprintf(buffer, sizeof(buffer), str, args);
        len = min(len, sizeof(buffer) - 1);
 
+       if (is_backend)
+               len = fio_server_text_output(FIO_LOG_INFO, buffer, len);
        if (log_syslog)
                syslog(LOG_INFO, "%s", buffer);
        else
diff --git a/log.h b/log.h
index a885be7253628e28950115944cca2d937be653c7..e5093139f0c24e1e061fb638d898aa8d79869e60 100644 (file)
--- a/log.h
+++ b/log.h
@@ -9,7 +9,6 @@ extern FILE *f_err;
 
 extern int log_err(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
 extern int log_info(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
-extern int log_local(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
 extern int log_valist(const char *str, va_list);
 extern int log_local_buf(const char *buf, size_t);
 extern int log_info_flush(void);