21# include "config_auto.h"
34#define MAX_MSG_LEN 2048
38static STRING_VAR(debug_file,
"",
"File to send tprintf output to");
42 const char *debug_file_name = debug_file.c_str();
43 static FILE *debugfp =
nullptr;
45 if (debug_file_name ==
nullptr) {
52 if (strcmp(debug_file_name,
"/dev/null") == 0) {
53 debug_file_name =
"nul";
54 debug_file.set_value(debug_file_name);
58 if (debugfp ==
nullptr && debug_file_name[0] !=
'\0') {
59 debugfp = fopen(debug_file_name,
"wb");
60 }
else if (debugfp !=
nullptr && debug_file_name[0] ==
'\0') {
66 va_start(args, format);
67 if (debugfp !=
nullptr) {
68 vfprintf(debugfp, format, args);
70 vfprintf(stderr, format, args);
#define INT_VAR(name, val, comment)
#define STRING_VAR(name, val, comment)
void tprintf(const char *format,...)