xrootd
XrdCmsTrace.hh
Go to the documentation of this file.
1 #ifndef _XRDCMS_TRACE_H
2 #define _XRDCMS_TRACE_H
3 /******************************************************************************/
4 /* */
5 /* X r d C m s T r a c e . h h */
6 /* */
7 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include "XrdSys/XrdSysError.hh"
16 #include "XrdOuc/XrdOucTrace.hh"
17 
18 #define TRACE_ALL 0xffff
19 #define TRACE_Debug 0x0001
20 #define TRACE_Stage 0x0002
21 #define TRACE_Defer 0x0004
22 #define TRACE_Forward 0x0008
23 #define TRACE_Redirect 0x0010
24 #define TRACE_Files 0x0020
25 
26 #ifndef NODEBUG
27 
28 #include "XrdSys/XrdSysHeaders.hh"
29 
30 #define QTRACE(act) Trace.What & TRACE_ ## act
31 
32 #define DEBUGR(y) if (Trace.What & TRACE_Debug) \
33  {Trace.Beg(epname, Arg.Ident); cerr <<y; Trace.End();}
34 
35 #define DEBUG(y) if (Trace.What & TRACE_Debug) TRACEX(y)
36 
37 #define TRACE(x,y) if (Trace.What & TRACE_ ## x) TRACEX(y)
38 
39 #define TRACER(x,y) if (Trace.What & TRACE_ ## x) \
40  {Trace.Beg(epname, Arg.Ident); cerr <<y; Trace.End();}
41 
42 #define TRACEX(y) {Trace.Beg(0,epname); cerr <<y; Trace.End();}
43 
44 #define EPNAME(x) static const char *epname = x;
45 
46 #else
47 
48 #define DEBUG(y)
49 #define TRACE(x, y)
50 #define EPNAME(x)
51 
52 #endif
53 
54 namespace XrdCms
55 {
56 extern XrdOucTrace Trace;
57 extern XrdSysError Say;
58 }
59 #endif