xrootd
XrdTrace.hh
Go to the documentation of this file.
1 #ifndef _XRD_TRACE_H
2 #define _XRD_TRACE_H
3 /******************************************************************************/
4 /* */
5 /* X r d T r a c e . h h */
6 /* */
7 /* (C) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC03-76-SFO0515 with the Deprtment of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 // Trace flags
16 //
17 #define TRACE_NONE 0x0000
18 #define TRACE_ALL 0x0fff
19 #define TRACE_DEBUG 0x0001
20 #define TRACE_CONN 0x0002
21 #define TRACE_MEM 0x0004
22 #define TRACE_NET 0x0008
23 #define TRACE_POLL 0x0010
24 #define TRACE_PROT 0x0020
25 #define TRACE_SCHED 0x0040
26 
27 #ifndef NODEBUG
28 
29 #include "XrdSys/XrdSysHeaders.hh"
30 #include "XrdOuc/XrdOucTrace.hh"
31 
32 #ifndef XRD_TRACE
33 #define XRD_TRACE XrdTrace.
34 #endif
35 
36 #define TRACE(act, x) \
37  if (XRD_TRACE What & TRACE_ ## act) \
38  {XRD_TRACE Beg(TraceID); cerr <<x; XRD_TRACE End();}
39 
40 #define TRACEI(act, x) \
41  if (XRD_TRACE What & TRACE_ ## act) \
42  {XRD_TRACE Beg(TraceID,TRACELINK->ID); cerr <<x; \
43  XRD_TRACE End();}
44 
45 #define TRACING(x) XRD_TRACE What & x
46 
47 #else
48 
49 #define TRACE(act,x)
50 #define TRACEI(act,x)
51 #define TRACING(x) 0
52 #endif
53 
54 #endif