2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
14 #include <afs/param.h>
18 #include "TaAfsAdmSvrInternal.h"
22 * VARIABLES __________________________________________________________________
26 static DWORD PrintDetailLevel
= dlDEFAULT
;
30 * ROUTINES ___________________________________________________________________
34 void cdecl vPrint (DWORD level
, LPTSTR pszLine
, va_list arg
)
36 static LPCRITICAL_SECTION pcs
= NULL
;
39 pcs
= New (CRITICAL_SECTION
);
40 InitializeCriticalSection (pcs
);
43 EnterCriticalSection (pcs
);
45 if ((!level
) || (PrintDetailLevel
& level
))
48 wvsprintf (szOut
, pszLine
, arg
);
52 if (level
& dlINDENT1
)
54 if (level
& dlINDENT2
)
56 printf ("%s\n", szOut
);
59 LeaveCriticalSection (pcs
);
63 void cdecl Print (LPTSTR pszLine
, ...)
66 va_start (arg
, pszLine
);
67 vPrint (dlSTANDARD
, pszLine
, arg
);
71 void cdecl Print (DWORD level
, LPTSTR pszLine
, ...)
74 va_start (arg
, pszLine
);
75 vPrint (level
, pszLine
, arg
);
79 DWORD
GetPrintDetailLevel (void)
81 return PrintDetailLevel
;
85 void SetPrintDetailLevel (DWORD level
)
87 PrintDetailLevel
= level
;