blob: c51f7848e8827208f340891f603a9fa97b02006f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/** BEGIN COPYRIGHT BLOCK
* Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
* Copyright (C) 2005 Red Hat, Inc.
* All rights reserved.
* END COPYRIGHT BLOCK **/
/******************************************************
*
* ntdebug.c - Sends debug output to window and stdout
* on Win32 platforms.
*
******************************************************/
#if defined( _WIN32 )
#include <windows.h>
#include <time.h>
#include <stdio.h>
#if defined( SLAPD_LOGGING )
#include "slap.h"
#include "proto-slap.h"
#else
#include "ldap.h"
#include "ldaplog.h"
#endif
int slapd_ldap_debug = LDAP_DEBUG_ANY;
FILE *error_logfp = NULL;
void LDAPDebug( int level, char *fmt, ... )
{
va_list arg_ptr;
va_start( arg_ptr, fmt );
if ( slapd_ldap_debug & level )
{
char szFormattedString[512];
PR_vsnprintf( szFormattedString, sizeof( szFormattedString ), fmt, arg_ptr );
#if defined( LDAP_DEBUG )
/* Send to debug window ...*/
OutputDebugString( szFormattedString );
/* ... and to stderr */
fprintf( stderr, szFormattedString );
#endif
#if defined( SLAPD_LOGGING )
if ( error_logfp != NULL )
slapd_log_error( error_logfp, szFormattedString );
#endif
}
va_end( arg_ptr );
}
#endif
|