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

@@ -357,6 +357,22 @@ inline eng::string ss(const ARGS & ... args) {
return oss.str();
}
// dprintf
//
// Send a debugging message to somewhere that it can be seen. This routine
// initially just sends output to stderr. But it can be hooked to send output
// somewhere else, like to a debug output window.
//
// The hook function must be a function that accepts a single line of text. The
// hook function will always be passed one line, consisting of printable
// characters only. There will be no control characters. The newline is
// implied.
//
void dprintf(const char *format, ...);
void hook_dprintf(void (*func)(const char *oneline));
// A better API than std::setfill, std::hex, std::setw, std::setprecision
//
// Usage examples: