summaryrefslogtreecommitdiff
path: root/src/debug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug.cpp')
-rw-r--r--src/debug.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/debug.cpp b/src/debug.cpp
index 1b811b9cc..d6104f9b0 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -176,3 +176,20 @@ const char *GetDebugString()
return dbgstr;
}
+
+#ifdef DEBUG_DUMP_COMMANDS
+#include "fileio.h"
+
+void CDECL DebugDumpCommands(const char *s, ...)
+{
+ static FILE *f = FioFOpenFile("commands-out.log", "wb", AUTOSAVE_DIR);
+ if (f == NULL) return;
+
+ va_list va;
+ va_start(va, s);
+ vfprintf(f, s, va);
+ va_end(va);
+
+ fflush(f);
+}
+#endif /* DEBUG_DUMP_COMMANDS */