00001 #ifndef ___SECPWD_TRACE_H___ 00002 #define ___SECPWD_TRACE_H___ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d S e c g s i T r a c e . h h */ 00006 /* */ 00007 /* (C) 2012 G. Ganis, CERN */ 00008 /* */ 00009 /* This file is part of the XRootD software suite. */ 00010 /* */ 00011 /* XRootD is free software: you can redistribute it and/or modify it under */ 00012 /* the terms of the GNU Lesser General Public License as published by the */ 00013 /* Free Software Foundation, either version 3 of the License, or (at your */ 00014 /* option) any later version. */ 00015 /* */ 00016 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00017 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00018 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00019 /* License for more details. */ 00020 /* */ 00021 /* You should have received a copy of the GNU Lesser General Public License */ 00022 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00023 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00024 /* */ 00025 /* The copyright holder's institutional names and contributor's names may not */ 00026 /* be used to endorse or promote products derived from this software without */ 00027 /* specific prior written permission of the institution or contributor. */ 00028 /* */ 00029 /******************************************************************************/ 00030 00031 #include "XrdOuc/XrdOucTrace.hh" 00032 00033 #ifndef NODEBUG 00034 00035 #include "XrdSys/XrdSysHeaders.hh" 00036 00037 #define QTRACE(act) (pwdTrace && (pwdTrace->What & TRACE_ ## act)) 00038 #define PRINT(y) {if (pwdTrace) {pwdTrace->Beg(epname); \ 00039 cerr <<y; pwdTrace->End();}} 00040 #define TRACE(act,x) if (QTRACE(act)) PRINT(x) 00041 #define NOTIFY(y) TRACE(Debug,y) 00042 #define DEBUG(y) TRACE(Authen,y) 00043 #define EPNAME(x) static const char *epname = x; 00044 00045 #else 00046 00047 #define QTRACE(x) 00048 #define PRINT(x) 00049 #define TRACE(x,y) 00050 #define NOTIFY(x) 00051 #define DEBUG(x) 00052 #define EPNAME(x) 00053 00054 #endif 00055 00056 #define TRACE_ALL 0x000f 00057 #define TRACE_Dump 0x0004 00058 #define TRACE_Authen 0x0002 00059 #define TRACE_Debug 0x0001 00060 00061 // 00062 // For error logging and tracing 00063 extern XrdOucTrace *pwdTrace; 00064 00065 #endif