Making progress on util::dprintf

This commit is contained in:
2023-02-27 17:21:00 -05:00
parent 596e39add8
commit aa77480fb5
6 changed files with 97 additions and 1 deletions

View File

@@ -9,6 +9,11 @@ static void if_error_print_and_exit(const std::string_view str) {
}
}
static void dprintf_callback(const char *oneline) {
fprintf(stderr, "DPRINTF: %s\n", oneline);
fflush(stderr);
}
class Driver {
public:
enum ChanState {
@@ -536,6 +541,7 @@ class Driver {
// Load the DLL and gain access to its functions.
call_init_engine_wrapper(&engw);
engw.replay_cb_sent_outgoing = replay_cb_sent_outgoing;
engw.hook_dprintf(dprintf_callback);
// If argv contains "replay <filename>", do a replay,
// and then skip everything else.