xrootd
XrdOssTrace.hh
Go to the documentation of this file.
1 #ifndef _XRDOSS_TRACE_H
2 #define _XRDOSS_TRACE_H
3 /******************************************************************************/
4 /* */
5 /* X r d O s s T r a c e . h h */
6 /* */
7 /* (C) 2003 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-AC03-76-SFO0515 with the Deprtment of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include "XrdOuc/XrdOucTrace.hh"
16 
17 // Trace flags
18 //
19 #define TRACE_ALL 0x0fff
20 #define TRACE_Opendir 0x0001
21 #define TRACE_Open 0x0002
22 #define TRACE_AIO 0x0004
23 #define TRACE_Debug 0x0800
24 
25 #ifndef NODEBUG
26 
27 #include "XrdSys/XrdSysHeaders.hh"
28 
29 #define QTRACE(act) OssTrace.What & TRACE_ ## act
30 
31 #define TRACE(act, x) \
32  if (QTRACE(act)) \
33  {OssTrace.Beg(epname,tident); cerr <<x; OssTrace.End();}
34 
35 #define TRACEReturn(type, ecode, msg) \
36  {TRACE(type, "err " <<ecode <<msg); return ecode;}
37 
38 #define DEBUG(y) if (QTRACE(Debug)) \
39  {OssTrace.Beg(epname); cerr <<y; OssTrace.End();}
40 
41 #define EPNAME(x) static const char *epname = x;
42 
43 #else
44 
45 #define DEBUG(x)
46 #define QTRACE(x) 0
47 #define TRACE(x, y)
48 #define TRACEReturn(type, ecode, msg) return ecode
49 #define EPNAME(x)
50 
51 #endif
52 #endif