Skip to content

Commit

Permalink
rdpq_debug: allow calling rdpq_debug_log without rdpq_debug_start
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Nov 14, 2024
1 parent fcd0734 commit 42d6636
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/rdpq/rdpq_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,13 @@ void rdpq_debug_start(void)

void rdpq_debug_log(bool log)
{
assertf(rdpq_trace, "rdpq trace engine not started");
rdpq_passthrough_write((RDPQ_CMD_DEBUG, RDPQ_CMD_DEBUG_SHOWLOG, log ? 1 : 0));
static bool warning = false;
if (log && !rdpq_trace && !warning) {
debugf("WARNING: rdpq_debug_log(true) ignored because trace engine was not started\n");
warning = true;
}
if (rdpq_trace)
rdpq_passthrough_write((RDPQ_CMD_DEBUG, RDPQ_CMD_DEBUG_SHOWLOG, log ? 1 : 0));
}

void rdpq_debug_log_msg(const char *msg)
Expand Down

0 comments on commit 42d6636

Please sign in to comment.