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 <afsconfig.h>
15 #include <afs/param.h>
20 #include "TaAfsAdmSvrInternal.h"
24 * VARIABLES __________________________________________________________________
28 static DWORD PrintDetailLevel = dlDEFAULT;
32 * ROUTINES ___________________________________________________________________
36 void cdecl vPrint (DWORD level, LPTSTR pszLine, va_list arg)
38 static LPCRITICAL_SECTION pcs = NULL;
41 pcs = New (CRITICAL_SECTION);
42 InitializeCriticalSection (pcs);
45 EnterCriticalSection (pcs);
47 if ((!level) || (PrintDetailLevel & level))
50 wvsprintf (szOut, pszLine, arg);
54 if (level & dlINDENT1)
56 if (level & dlINDENT2)
58 printf ("%s\n", szOut);
61 LeaveCriticalSection (pcs);
65 void cdecl Print (LPTSTR pszLine, ...)
68 va_start (arg, pszLine);
69 vPrint (dlSTANDARD, pszLine, arg);
73 void cdecl Print (DWORD level, LPTSTR pszLine, ...)
76 va_start (arg, pszLine);
77 vPrint (level, pszLine, arg);
81 DWORD GetPrintDetailLevel (void)
83 return PrintDetailLevel;
87 void SetPrintDetailLevel (DWORD level)
89 PrintDetailLevel = level;