XRootD
Loading...
Searching...
No Matches
XrdSysTrace.hh File Reference
#include <iostream>
#include <sys/uio.h>
#include "XrdSys/XrdSysPthread.hh"
+ Include dependency graph for XrdSysTrace.hh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  XrdSysTrace
 

Namespaces

namespace  Xrd
 

Macros

#define SYSTRACE(obj, usr, epn, txt, dbg)    obj Beg(usr, epn, txt) <<dbg <<obj End();
 

Enumerations

enum  Xrd::Fmt {
  Xrd::dec =0 ,
  Xrd::hex =2 ,
  Xrd::hex1 =3 ,
  Xrd::oct =4 ,
  Xrd::oct1 =5
}
 

Macro Definition Documentation

◆ SYSTRACE

#define SYSTRACE (   obj,
  usr,
  epn,
  txt,
  dbg 
)     obj Beg(usr, epn, txt) <<dbg <<obj End();

Definition at line 45 of file XrdSysTrace.hh.

48{
49public:
50
51XrdSysTrace& Beg(const char *usr=0, const char *epn=0, const char *txt=0);
52
53XrdSysTrace *End() {return this;}
54
55void SetLogger(XrdSysLogger *logp);
56
57typedef void (*msgCB_t)(const char *tid, const char *msg, bool dbgmsg);
58
59void SetLogger(msgCB_t cbP);
60
61inline bool Tracing(int mask) {return (mask & What) != 0;}
62
63 int What;
64
65XrdSysTrace& operator<<(bool val);
66
67XrdSysTrace& operator<<( char val);
68XrdSysTrace& operator<<(const char *val);
69 XrdSysTrace& operator<<(const std::string& val);
70
71XrdSysTrace& operator<<(short val);
72XrdSysTrace& operator<<(int val);
73XrdSysTrace& operator<<(long val);
74XrdSysTrace& operator<<(long long val);
75
76XrdSysTrace& operator<<(unsigned short val);
77XrdSysTrace& operator<<(unsigned int val);
78XrdSysTrace& operator<<(unsigned long val);
79XrdSysTrace& operator<<(unsigned long long val);
80
81XrdSysTrace& operator<<(float val)
82 {return Insert(static_cast<long double>(val));}
83XrdSysTrace& operator<<(double val)
84 {return Insert(static_cast<long double>(val));}
85XrdSysTrace& operator<<(long double val)
86 {return Insert(val);}
87
88XrdSysTrace& operator<<(void* val);
89
90XrdSysTrace& operator<<(Xrd::Fmt val) {doFmt = val; return *this;}
91
93
94 XrdSysTrace(const char *pfx, XrdSysLogger *logp=0, int tf=0)
95 : What(tf), logP(logp), iName(pfx), dPnt(0),
96 dFree(txtMax), vPnt(1), doFmt(Xrd::dec) {}
97 ~XrdSysTrace() {}
98
99private:
100
101XrdSysTrace& Insert(long double val);
102
103static const int iovMax = 16;
104static const int pfxMax = 256;
105static const int txtMax = 256;
106
107static const int doOne =0x01;
108
109XrdSysMutex myMutex;
110XrdSysLogger *logP;
111const char *iName;
112short dPnt;
113short dFree;
114short vPnt;
115Xrd::Fmt doFmt;
116struct iovec ioVec[iovMax];
117char pBuff[pfxMax];
118char dBuff[txtMax];
119};
120#endif
std::ostream & operator<<(std::ostream &os, const XrdOucString s)