00001 // $Id: XrdCryptoAux.cc 30949 2009-11-02 16:37:58Z ganis $ 00002 00003 const char *XrdCryptoAuxCVSID = "$Id: XrdCryptoAux.cc 30949 2009-11-02 16:37:58Z ganis $"; 00004 /******************************************************************************/ 00005 /* */ 00006 /* X r d C r y p t o A u x . c c */ 00007 /* */ 00008 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */ 00009 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00010 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00011 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00012 /******************************************************************************/ 00013 00014 #include <XrdSys/XrdSysLogger.hh> 00015 #include <XrdSys/XrdSysError.hh> 00016 00017 #include <XrdCrypto/XrdCryptoAux.hh> 00018 #include <XrdCrypto/XrdCryptoTrace.hh> 00019 00020 // 00021 // For error logging and tracing 00022 static XrdSysLogger Logger; 00023 static XrdSysError eDest(0,"crypto_"); 00024 XrdOucTrace *cryptoTrace = 0; 00025 00026 /******************************************************************************/ 00027 /* X r d C r y p t o S e t T r a c e */ 00028 /******************************************************************************/ 00029 //______________________________________________________________________________ 00030 void XrdCryptoSetTrace(kXR_int32 trace) 00031 { 00032 // Set trace flags according to 'trace' 00033 00034 // 00035 // Initiate error logging and tracing 00036 eDest.logger(&Logger); 00037 if (!cryptoTrace) 00038 cryptoTrace = new XrdOucTrace(&eDest); 00039 if (cryptoTrace) { 00040 // Set debug mask 00041 cryptoTrace->What = 0; 00042 // Low level only 00043 if ((trace & cryptoTRACE_Notify)) 00044 cryptoTrace->What |= cryptoTRACE_Notify; 00045 // Medium level 00046 if ((trace & cryptoTRACE_Debug)) 00047 cryptoTrace->What |= (cryptoTRACE_Notify | cryptoTRACE_Debug); 00048 // High level 00049 if ((trace & cryptoTRACE_Dump)) 00050 cryptoTrace->What |= cryptoTRACE_ALL; 00051 } 00052 }