diff --git a/v900.cc b/v900.cc index baf5a326b..4f4d69c99 100644 --- a/v900.cc +++ b/v900.cc @@ -75,7 +75,7 @@ for a little more info, see structures: #include // for assert #include // for va_end, va_start -#include // for fclose, fgets, fread, vfprintf, stderr, va_list +#include // for fclose, fgets, fread, va_list #include // for strtod #include // for strncmp, strcat, strcpy, strstr @@ -91,15 +91,12 @@ for a little more info, see structures: void V900Format::v900_log(const char* fmt, ...) { - va_list ap; - - if (global_opts.debug_level < 1) { - return; + if (global_opts.debug_level >= 1) { + va_list ap; + va_start(ap, fmt); + db.vlog(fmt, ap); + va_end(ap); } - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); } void diff --git a/v900.h b/v900.h index 5a2b578f7..2a4d5c398 100644 --- a/v900.h +++ b/v900.h @@ -124,11 +124,12 @@ class V900Format : public Format /* Member Functions */ - [[gnu::format(printf, 1, 2)]] static void v900_log(const char* fmt, ...); + [[gnu::format(printf, 2, 3)]] void v900_log(const char* fmt, ...); static QDateTime bintime2utc(int date, int time); /* Data Members */ + DebugLog db; FILE* fin = nullptr; };