Skip to content

Commit

Permalink
use DebugLog for v900
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Nov 2, 2024
1 parent 919b02f commit 3638506
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
15 changes: 6 additions & 9 deletions v900.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ for a little more info, see structures:

#include <cassert> // for assert
#include <cstdarg> // for va_end, va_start
#include <cstdio> // for fclose, fgets, fread, vfprintf, stderr, va_list
#include <cstdio> // for fclose, fgets, fread, va_list
#include <cstdlib> // for strtod
#include <cstring> // for strncmp, strcat, strcpy, strstr

Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion v900.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 3638506

Please sign in to comment.