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