From 7526e2b02716760a6ed05b6f35f7e5a67cebdb87 Mon Sep 17 00:00:00 2001 From: cbdev Date: Thu, 1 Jul 2021 23:07:17 +0200 Subject: Route log output to frontend --- midimonster.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'midimonster.c') diff --git a/midimonster.c b/midimonster.c index 5e415e6..d00f116 100644 --- a/midimonster.c +++ b/midimonster.c @@ -1,5 +1,6 @@ #include #include +#include #ifndef _WIN32 #define MM_API __attribute__((visibility("default"))) #else @@ -13,6 +14,16 @@ volatile static sig_atomic_t shutdown_requested = 0; +MM_API int log_printf(int level, char* module, char* fmt, ...){ + int rv = 0; + va_list args; + va_start(args, fmt); + fprintf(stderr, "%s%s\t", level ? "debug/" : "", module); + rv = vfprintf(stderr, fmt, args); + va_end(args); + return rv; +} + static void signal_handler(int signum){ shutdown_requested = 1; } -- cgit v1.2.3