Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added debug implementation
Jack Lange [Tue, 26 May 2009 03:15:54 +0000 (22:15 -0500)]
misc/network_servers/vtl/debug.cc [new file with mode: 0644]

diff --git a/misc/network_servers/vtl/debug.cc b/misc/network_servers/vtl/debug.cc
new file mode 100644 (file)
index 0000000..ce2cac8
--- /dev/null
@@ -0,0 +1,38 @@
+#include "debug.h"
+#include <time.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+static FILE * logfile = NULL;
+static int debug_on = 0;
+
+int vtl_debug_init(string logfilename, int debug_enable) {
+    debug_on = debug_enable; 
+    logfile = fopen(logfilename.c_str(), "w+");
+    return 0;
+}
+
+
+
+void vtl_debug(const char * fmt, ...) {
+    if (debug_on) {
+       va_list args;
+       time_t dbgt;
+       struct tm * time_data;
+       char time_str[200];
+
+       time(&dbgt); 
+       time_data = localtime(&dbgt);
+
+
+       strftime(time_str, sizeof(time_str), "%a %b %d %r %Y : ", time_data);
+
+       fprintf(logfile, "%s", time_str); 
+
+       va_start(args, fmt);
+       vfprintf(logfile, fmt, args);
+       va_end(args);
+
+       fflush(logfile);
+    }
+}