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
11 #include <afs/param.h>
15 #include "TaAfsAdmSvrInternal.h"
19 * VARIABLES __________________________________________________________________
23 static DWORD PrintDetailLevel = dlDEFAULT;
27 * ROUTINES ___________________________________________________________________
31 void cdecl vPrint (DWORD level, LPTSTR pszLine, va_list arg)
33 static LPCRITICAL_SECTION pcs = NULL;
36 pcs = New (CRITICAL_SECTION);
37 InitializeCriticalSection (pcs);
40 EnterCriticalSection (pcs);
42 if ((!level) || (PrintDetailLevel & level))
45 wvsprintf (szOut, pszLine, arg);
49 if (level & dlINDENT1)
51 if (level & dlINDENT2)
53 printf ("%s\n", szOut);
56 LeaveCriticalSection (pcs);
60 void cdecl Print (LPTSTR pszLine, ...)
63 va_start (arg, pszLine);
64 vPrint (dlSTANDARD, pszLine, arg);
68 void cdecl Print (DWORD level, LPTSTR pszLine, ...)
71 va_start (arg, pszLine);
72 vPrint (level, pszLine, arg);
76 DWORD GetPrintDetailLevel (void)
78 return PrintDetailLevel;
82 void SetPrintDetailLevel (DWORD level)
84 PrintDetailLevel = level;