xrootd
XrdFrcTrace.hh
Go to the documentation of this file.
1 #ifndef _XRDFRC_TRACE_H
2 #define _XRDFRC_TRACE_H
3 /******************************************************************************/
4 /* */
5 /* X r d F r c T r a c e . h h */
6 /* */
7 /* (c) 2009 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 #include "XrdSys/XrdSysError.hh"
14 #include "XrdOuc/XrdOucTrace.hh"
15 
16 #define TRACE_ALL 0xffff
17 #define TRACE_Debug 0x0001
18 
19 #ifndef NODEBUG
20 
21 #include "XrdSys/XrdSysHeaders.hh"
22 
23 #define QTRACE(act) Trace.What & TRACE_ ## act
24 
25 #define DEBUGR(y) if (Trace.What & TRACE_Debug) \
26  {Trace.Beg(epname, Req.User); cerr <<y; Trace.End();}
27 
28 #define DEBUG(y) if (Trace.What & TRACE_Debug) TRACEX(y)
29 
30 #define TRACE(x,y) if (Trace.What & TRACE_ ## x) TRACEX(y)
31 
32 #define TRACER(x,y) if (Trace.What & TRACE_ ## x) \
33  {Trace.Beg(epname, Req.User); cerr <<y; Trace.End();}
34 
35 #define TRACEX(y) {Trace.Beg(0,epname); cerr <<y; Trace.End();}
36 #define EPNAME(x) static const char *epname = x;
37 
38 #else
39 
40 #define DEBUG(y)
41 #define TRACE(x, y)
42 #define EPNAME(x)
43 
44 #endif
45 
46 #define VMSG(a,...) if (Config.Verbose) Say.Emsg(a,__VA_ARGS__);
47 
48 #define VSAY(a,...) if (Config.Verbose) Say.Say(a,__VA_ARGS__);
49 
50 namespace XrdFrc
51 {
52 extern XrdSysError Say;
53 extern XrdOucTrace Trace;
54 }
55 #endif