XRootD
XrdHttpTrace.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of XrdHTTP: A pragmatic implementation of the
3 // HTTP/WebDAV protocol for the Xrootd framework
4 //
5 // Copyright (c) 2013 by European Organization for Nuclear Research (CERN)
6 // Author: Fabrizio Furano <furano@cern.ch>
7 // File Date: Nov 2012
8 //------------------------------------------------------------------------------
9 // XRootD is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU Lesser General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // XRootD is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public License
20 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
21 //------------------------------------------------------------------------------
22 
23 
24 
25 
26 
27 
28 
29 
30 
41 #ifndef _XROOTD_TRACE_H
42 #define _XROOTD_TRACE_H
43 
44 
45 // Trace flags
46 //
47 #define TRACE_ALL 0x0fff
48 #define TRACE_AUTH 0x0001
49 #define TRACE_DEBUG 0x0002
50 #define TRACE_MEM 0x0010
51 #define TRACE_REQ 0x0020
52 #define TRACE_REDIR 0x0040
53 #define TRACE_RSP 0x0080
54 
55 #ifndef NODEBUG
56 
57 #include "XrdSys/XrdSysHeaders.hh"
58 #include "XrdSys/XrdSysTrace.hh"
59 
60 
62 
63 #define TRACE(act, x) \
64  if (XrdHttpTrace.What & TRACE_ ## act) \
65  {SYSTRACE(XrdHttpTrace., 0, TraceID, 0, x)}
66 
67 #define TRACEI(act, x) \
68  if (XrdHttpTrace.What & TRACE_ ## act) \
69  {SYSTRACE(XrdHttpTrace., TRACELINK->ID, TraceID, 0, x)}
70 
71 #define TRACING(x) XrdHttpTrace.What & x
72 #define EPNAME(x) static const char* epname = x;
73 
74 #else
75 
76 #define TRACE(act,x)
77 #define TRACEI(act,x)
78 #define TRACEP(act,x)
79 #define TRACES(act,x)
80 #define TRACING(x) 0
81 #define EPNAME(x)
82 #endif
83 
84 #endif
XrdSysTrace XrdHttpTrace