--- /dev/null
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "trace.h"
+
+int trace_level = TRACE_INFO;
+
+void print_trace(const char *file, int line, int l,
+ const char *fmt, ...)
+{
+ FILE *out_file;
+ va_list args;
+
+ if (l > trace_level)
+ return;
+
+ if (l == TRACE_ERR)
+ out_file = stderr;
+ else
+ out_file = stdout;
+
+ va_start(args, fmt);
+ vfprintf(out_file, fmt, args);
+ va_end(args);
+}