aboutsummaryrefslogtreecommitdiff
path: root/wfm.c
diff options
context:
space:
mode:
authortenox7 <as@tenoware.com>2017-12-17 15:27:39 -0800
committertenox7 <as@tenoware.com>2017-12-17 15:27:39 -0800
commitf82825f63d25a6e117d01324860202977a0ced3d (patch)
tree188a8b9f70cc139f61b45500167aabb0fa947dd7 /wfm.c
parentfcd107e17ba9bb04fd7cdb9fc81fadf8fd32c5a6 (diff)
downloadwfm-f82825f63d25a6e117d01324860202977a0ced3d.tar.gz
added dbgprintf
Diffstat (limited to 'wfm.c')
-rw-r--r--wfm.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/wfm.c b/wfm.c
index 15d84a1..2d81659 100644
--- a/wfm.c
+++ b/wfm.c
@@ -348,6 +348,31 @@ char *buprintf(float v, int bold) {
}
//
+// Debug print to a file
+//
+void dbgprintf(char *msg, ...) {
+ va_list ap;
+ char buff[1024]={0};
+ FILE *f;
+
+ if(msg) {
+ va_start(ap, msg);
+ vsnprintf(buff, sizeof(buff), msg, ap);
+ va_end(ap);
+
+ f=fopen("/tmp/wfmdbg.log", "a");
+ if(!f)
+ error("Unable to open debug file");
+
+ fprintf(f, "DEBUG: %s\n", buff);
+
+ fclose(f);
+ }
+
+}
+
+
+//
// redirect browser
//
void redirect(char *location, ...) {