Add tracing infrastructure.
[SXSI/xpathcomp.git] / include / trace.ml
diff --git a/include/trace.ml b/include/trace.ml
new file mode 100644 (file)
index 0000000..21e3a95
--- /dev/null
@@ -0,0 +1,27 @@
+IFNDEF TRACE__ML__
+THEN
+DEFINE TRACE__ML__
+
+let __ x =
+  ignore (Format.flush_str_formatter());
+  Format.kfprintf
+    (fun _ -> Format.flush_str_formatter())
+    Format.str_formatter x
+;;
+IFNDEF NTRACE
+THEN
+
+DEFINE TRACE(t, l, r) =
+  (if l <= Tracer.level t then
+      Tracer.trace t l (r))
+
+ELSE
+
+DEFINE TRACE(t, l, r) = ()
+
+END
+
+
+
+
+END