xrootd
XrdFrcTrace.hh
Go to the documentation of this file.
00001 #ifndef _XRDFRC_TRACE_H
00002 #define _XRDFRC_TRACE_H
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                        X r d F r c T r a c e . h h                         */
00006 /*                                                                            */
00007 /* (c) 2009 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*                            All Rights Reserved                             */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC02-76-SFO0515 with the Department of Energy              */
00011 /******************************************************************************/
00012 
00013 #include "XrdSys/XrdSysError.hh"
00014 #include "XrdOuc/XrdOucTrace.hh"
00015 
00016 #define TRACE_ALL       0xffff
00017 #define TRACE_Debug     0x0001
00018 
00019 #ifndef NODEBUG
00020 
00021 #include "XrdSys/XrdSysHeaders.hh"
00022 
00023 #define QTRACE(act) Trace.What & TRACE_ ## act
00024 
00025 #define DEBUGR(y) if (Trace.What & TRACE_Debug) \
00026                   {Trace.Beg(epname, Req.User); cerr <<y; Trace.End();}
00027 
00028 #define DEBUG(y) if (Trace.What & TRACE_Debug) TRACEX(y)
00029 
00030 #define TRACE(x,y) if (Trace.What & TRACE_ ## x) TRACEX(y)
00031 
00032 #define TRACER(x,y) if (Trace.What & TRACE_ ## x) \
00033                        {Trace.Beg(epname, Req.User); cerr <<y; Trace.End();}
00034 
00035 #define TRACEX(y) {Trace.Beg(0,epname); cerr <<y; Trace.End();}
00036 #define EPNAME(x) static const char *epname = x;
00037 
00038 #else
00039 
00040 #define DEBUG(y)
00041 #define TRACE(x, y)
00042 #define EPNAME(x)
00043 
00044 #endif
00045 
00046 #define VMSG(a,...) if (Config.Verbose) Say.Emsg(a,__VA_ARGS__);
00047 
00048 #define VSAY(a,...) if (Config.Verbose) Say.Say(a,__VA_ARGS__);
00049 
00050 namespace XrdFrc
00051 {
00052 extern XrdSysError  Say;
00053 extern XrdOucTrace  Trace;
00054 }
00055 #endif