XRootD
Loading...
Searching...
No Matches
XrdSysError Class Reference

#include <XrdSysError.hh>

+ Collaboration diagram for XrdSysError:

Public Member Functions

 XrdSysError (XrdSysLogger *lp, const char *ErrPrefix="sys")
 
 ~XrdSysError ()
 
int baseFD ()
 
void Emsg (const char *esfx, const char *text1, const char *text2=0, const char *text3=0)
 
int Emsg (const char *esfx, int ecode, const char *text1, const char *text2=0)
 
int getMsgMask ()
 
void Log (int mask, const char *esfx, const char *text1, const char *text2=0, const char *text3=0)
 
XrdSysLoggerlogger (XrdSysLogger *lp=0)
 
void Say (const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)
 
void setMsgMask (int mask)
 
const char * SetPrefix (const char *prefix)
 
void TBeg (const char *txt1=0, const char *txt2=0, const char *txt3=0)
 
void TEnd ()
 

Static Public Member Functions

static void addTable (XrdSysError_Table *etp)
 
static const char * ec2text (int ecode)
 

Detailed Description

Definition at line 89 of file XrdSysError.hh.

Constructor & Destructor Documentation

◆ XrdSysError()

XrdSysError::XrdSysError ( XrdSysLogger * lp,
const char * ErrPrefix = "sys" )
inline

Definition at line 92 of file XrdSysError.hh.

93 : epfx(0),
94 epfxlen(0),
95 msgMask(-1),
96 Logger(lp)
97 { SetPrefix(ErrPrefix); }
const char * SetPrefix(const char *prefix)

References SetPrefix().

+ Here is the call graph for this function:

◆ ~XrdSysError()

XrdSysError::~XrdSysError ( )
inline

Definition at line 99 of file XrdSysError.hh.

99{}

Member Function Documentation

◆ addTable()

static void XrdSysError::addTable ( XrdSysError_Table * etp)
inlinestatic

Definition at line 106 of file XrdSysError.hh.

106{etp->next = etab; etab = etp;}

Referenced by XrdOssSys::Configure().

+ Here is the caller graph for this function:

◆ baseFD()

int XrdSysError::baseFD ( )

Definition at line 73 of file XrdSysError.cc.

73{return Logger->originalFD();}

◆ ec2text()

const char * XrdSysError::ec2text ( int ecode)
static

Definition at line 79 of file XrdSysError.cc.

80{
81 int xcode;
82 const char *etxt = 0;
83 XrdSysError_Table *etp = etab;
84
85 xcode = (ecode < 0 ? -ecode : ecode);
86 while((etp != 0) && !(etxt = etp->Lookup(xcode))) etp = etp->next;
87 if (!etxt) etxt = XrdSysE2T(xcode);
88 return etxt;
89}
const char * XrdSysE2T(int errcode)
Definition XrdSysE2T.cc:104
char * Lookup(int mnum)

References XrdSysError_Table::Lookup(), and XrdSysE2T().

Referenced by Emsg(), and XrdOucERoute::Format().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Emsg() [1/2]

void XrdSysError::Emsg ( const char * esfx,
const char * text1,
const char * text2 = 0,
const char * text3 = 0 )

Definition at line 117 of file XrdSysError.cc.

120{
121 struct iovec iov[16];
122 int iovpnt = 0;
123
124 Set_IOV_Item(0,0); // 0
125 if (epfx && epfxlen) Set_IOV_Item(epfx, epfxlen); // 1
126 if (esfx ) Set_IOV_Buff(esfx); // 2
127 Set_IOV_Item(": ", 2); // 3
128 Set_IOV_Buff(txt1); // 4
129 if (txt2 && txt2[0]){Set_IOV_Item(" ", 1); // 5
130 Set_IOV_Buff(txt2);} // 6
131 if (txt3 && txt3[0]){Set_IOV_Item(" ", 1); // 7
132 Set_IOV_Buff(txt3);} // 8
133 Set_IOV_Item("\n", 1); // 9
134 Logger->Put(iovpnt, iov);
135}
#define Set_IOV_Item(x, y)
#define Set_IOV_Buff(x)

References Set_IOV_Buff, and Set_IOV_Item.

◆ Emsg() [2/2]

int XrdSysError::Emsg ( const char * esfx,
int ecode,
const char * text1,
const char * text2 = 0 )

Definition at line 95 of file XrdSysError.cc.

97{
98 struct iovec iov[16];
99 int iovpnt = 0;
100 const char *etxt = ec2text(ecode);
101
102 Set_IOV_Item(0,0); // 0
103 if (epfx && epfxlen) Set_IOV_Item(epfx, epfxlen); // 1
104 if (esfx ) Set_IOV_Buff(esfx); // 2
105 Set_IOV_Item(": Unable to ", 12); // 3
106 Set_IOV_Buff(txt1); // 4
107 if (txt2 && txt2[0]){Set_IOV_Item(" ", 1); // 5
108 Set_IOV_Buff(txt2); } // 6
109 Set_IOV_Item("; ", 2); // 7
110 Set_IOV_Buff(etxt); // 8
111 Set_IOV_Item("\n", 1); // 9
112 Logger->Put(iovpnt, iov);
113
114 return ecode;
115}
static const char * ec2text(int ecode)

References ec2text(), Set_IOV_Buff, and Set_IOV_Item.

Referenced by XrdOuca2x::a2fm(), XrdOuca2x::a2fm(), XrdOuca2x::a2i(), XrdOuca2x::a2ll(), XrdOuca2x::a2sn(), XrdOuca2x::a2sp(), XrdOuca2x::a2sz(), XrdOuca2x::a2tm(), XrdOuca2x::a2vp(), XrdNetSocket::Accept(), Macaroons::Handler::Config(), XrdNetPMarkCfg::Config(), XrdAccConfig::ConfigDB(), XrdOssSys::ConfigProc(), XrdOssSys::ConfigStage(), XrdOssSys::ConfigStageC(), XrdBwm::Configure(), XrdCephOss::Configure(), XrdOfs::Configure(), XrdOssSys::Configure(), XrdVomsMapfile::Configure(), XrdOfs::ConfigXeq(), XrdOssSys::ConfigXeq(), XrdTlsTempCA::TempCAGuard::create(), XrdPollE::Disable(), XrdPollPoll::Disable(), XrdPollPoll::doDetach(), XrdPollE::Enable(), XrdPollPoll::Enable(), XrdPollE::Exclude(), XrdPollPoll::Exclude(), XrdPollE::Include(), XrdPollPoll::Include(), XrdOfsEvr::Init(), XrdOucN2N::lfn2pfn(), Log(), XrdXrootdAdmin::Login(), main(), XrdPoll::newPoller(), XrdOfsEvs::Parse(), XrdOucPsx::ParseCache(), XrdOucPsx::ParseCio(), XrdOucPsx::ParseCLib(), XrdOucExport::ParseDefs(), XrdHttpProtocol::parseHeader2CGI(), XrdOucPsx::ParseINet(), XrdOucPsx::ParseMLib(), XrdOucPsx::ParseNLib(), XrdOucExport::ParsePath(), XrdOucPsx::ParseSet(), XrdOucPsx::ParseTrace(), XrdOucERoute::Route(), TagPath::SetPrefix(), XrdOucProg::Setup(), XrdBwmLogger::Start(), XrdOfsEvs::Start(), XrdPollE::Start(), XrdPollPoll::Start(), XrdOssSys::xalloc(), XrdOssSys::xcachescan(), XrdOssSys::xfdlimit(), XrdOssSys::xmaxsz(), XrdOssSys::xmemf(), XrdOssSys::xnml(), xonmissing(), XrdOssSys::xpath(), XrdOssSys::xprerd(), XrdAccAuthorizeObjAdd(), XrdAccAuthorizeObject(), XrdHttpGetExtHandler(), XrdHttpGetExtHandler(), XrdOssAddStorageSystem2(), XrdSysThread_Xeq(), XrdOssSys::xspace(), XrdOssSys::xspace(), XrdOssSys::xspaceBuild(), XrdOssSys::xstg(), XrdOssSys::xstl(), XrdOssSys::xtrace(), XrdOssSys::xusage(), and XrdOssSys::xxfr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMsgMask()

int XrdSysError::getMsgMask ( )
inline

Definition at line 156 of file XrdSysError.hh.

156{return msgMask;}

Referenced by XrdVomsMapfile::Configure().

+ Here is the caller graph for this function:

◆ Log()

void XrdSysError::Log ( int mask,
const char * esfx,
const char * text1,
const char * text2 = 0,
const char * text3 = 0 )
inline

Definition at line 133 of file XrdSysError.hh.

137 {if (mask & msgMask) Emsg(esfx, text1, text2, text3);}
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)

References Emsg().

+ Here is the call graph for this function:

◆ logger()

XrdSysLogger * XrdSysError::logger ( XrdSysLogger * lp = 0)
inline

Definition at line 141 of file XrdSysError.hh.

142 {XrdSysLogger *oldp = Logger;
143 if (lp) Logger = lp;
144 return oldp;
145 }

Referenced by TPC::TPCHandler::TPCHandler(), XrdScheduler::XrdScheduler(), XrdOssSys::ConfigStage(), XrdOssSys::ConfigStatLib(), XrdHttpProtocol::Configure(), XrdXrootdProtocol::Configure(), XrdCmsConfig::Configure0(), and XrdSysGetXAttrObject().

+ Here is the caller graph for this function:

◆ Say()

void XrdSysError::Say ( const char * text1,
const char * text2 = 0,
const char * txt3 = 0,
const char * text4 = 0,
const char * text5 = 0,
const char * txt6 = 0 )

Definition at line 141 of file XrdSysError.cc.

143{
144 struct iovec iov[9];
145 int iovpnt = 0;
146 if (txt1) Set_IOV_Buff(txt1) // 0
147 else Set_IOV_Item(0,0);
148 if (txt2 && txt2[0]) Set_IOV_Buff(txt2); // 1
149 if (txt3 && txt3[0]) Set_IOV_Buff(txt3); // 2
150 if (txt4 && txt4[0]) Set_IOV_Buff(txt4); // 3
151 if (txt5 && txt5[0]) Set_IOV_Buff(txt5); // 4
152 if (txt6 && txt6[0]) Set_IOV_Buff(txt6); // 5
153 Set_IOV_Item("\n", 1); // 6
154 Logger->Put(iovpnt, iov);
155}

References Set_IOV_Buff, and Set_IOV_Item.

Referenced by Macaroons::Handler::Config(), XrdNetPMarkCfg::Config(), XrdOfs::Config_Display(), XrdOssSys::Config_Display(), XrdAccConfig::ConfigDB(), XrdOssSys::ConfigMio(), XrdOssSys::ConfigProc(), XrdOssSys::ConfigSpace(), XrdOssSys::ConfigSpath(), XrdOssSys::ConfigStage(), XrdAccConfig::Configure(), XrdBwm::Configure(), XrdOfs::Configure(), XrdOssSys::Configure(), XrdBwm::ConfigXeq(), XrdOfs::ConfigXeq(), XrdOssSys::ConfigXeq(), XrdOssMio::Display(), XrdSecEntity::Display(), XrdOssCsiConfig::Init(), XrdOssCache::List(), XrdOssSys::List_Path(), XrdNetPMarkCfg::Parse(), XrdOfsEvs::Parse(), XrdOucPsx::ParseCLib(), XrdOucPsx::ParseSet(), XrdOucPsx::ParseTrace(), XrdOssSys::xcache(), XrdOssSys::xmemf(), XrdDigGetFS(), XrdgetProtocol(), XrdOucGetCache(), XrdSfsGetFileSystem(), XrdOssSys::xspace(), XrdOssSys::xspaceBuild(), and XrdOssSys::xtrace().

+ Here is the caller graph for this function:

◆ setMsgMask()

void XrdSysError::setMsgMask ( int mask)
inline

Definition at line 154 of file XrdSysError.hh.

154{msgMask = mask;}

Referenced by Macaroons::Handler::Config(), and XrdVomsMapfile::Configure().

+ Here is the caller graph for this function:

◆ SetPrefix()

const char * XrdSysError::SetPrefix ( const char * prefix)
inline

Definition at line 160 of file XrdSysError.hh.

161 {const char *oldpfx = epfx;
162 epfx = prefix; epfxlen = strlen(epfx);
163 return oldpfx;
164 }

Referenced by XrdSysError().

+ Here is the caller graph for this function:

◆ TBeg()

void XrdSysError::TBeg ( const char * txt1 = 0,
const char * txt2 = 0,
const char * txt3 = 0 )

Definition at line 161 of file XrdSysError.cc.

162{
163 std::cerr <<Logger->traceBeg();
164 if (txt1) std::cerr <<txt1 <<' ';
165 if (txt2) std::cerr <<epfx <<txt2 <<": ";
166 if (txt3) std::cerr <<txt3;
167}

◆ TEnd()

void XrdSysError::TEnd ( )

Definition at line 173 of file XrdSysError.cc.

173{std::cerr <<std::endl; Logger->traceEnd();}

The documentation for this class was generated from the following files: