]> git.sur5r.net Git - openldap/commitdiff
enable debug output for NT
authorGary Williams <gwilliams@openldap.org>
Thu, 1 Apr 1999 16:39:36 +0000 (16:39 +0000)
committerGary Williams <gwilliams@openldap.org>
Thu, 1 Apr 1999 16:39:36 +0000 (16:39 +0000)
servers/slapd/nt_debug.c [new file with mode: 0644]

diff --git a/servers/slapd/nt_debug.c b/servers/slapd/nt_debug.c
new file mode 100644 (file)
index 0000000..e506531
--- /dev/null
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <stdarg.h>
+
+static FILE *log_file;
+
+void Debug( int level, char *fmt, ... )
+{
+       char buffer[4096];
+       va_list vl;
+
+       if( log_file == NULL )
+               log_file = fopen( "C:\\OpenLDAP\\run\\slapd.log", "w" );
+
+       va_start( vl, fmt );
+       vsprintf( buffer, fmt, vl );
+       fprintf( log_file, "%s\n", buffer );
+       fflush( log_file );
+       va_end( vl );
+}