xrootd
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
XrdSsiLogger Class Reference

#include <XrdSsiLogger.hh>

Public Types

enum  mcbType { mcbAll =0 , mcbClient , mcbServer }
 
typedef void() MCB_t(struct timeval const &mtime, unsigned long tID, const char *msg, int mlen)
 Length of message text.
 

Public Member Functions

 XrdSsiLogger ()
 Constructor and destructor.
 
 ~XrdSsiLogger ()
 

Static Public Member Functions

static void Msg (const char *pfx, const char *txt1, const char *txt2=0, const char *txt3=0)
 
static void Msgf (const char *pfx, const char *fmt,...)
 
static void Msgv (const char *pfx, const char *fmt, va_list aP)
 
static void Msgv (struct iovec *iovP, int iovN)
 
static bool SetMCB (MCB_t &mcbP, mcbType mcbt=mcbAll)
 
static const char * TBeg ()
 
static void TEnd ()
 

Member Typedef Documentation

◆ MCB_t

typedef void() XrdSsiLogger::MCB_t(struct timeval const &mtime, unsigned long tID, const char *msg, int mlen)

Length of message text.

Set a message callback function for messages issued via this object. This method should be called during static initialization (this means the call needs to occur at global scope).

Parameters
mCBReference to the message callback function as defined by the typedef MCB_t.
mcbtSpecifies the type of callback being set, as follows: mcbAll - callback for client-side and server-side logging. mcbClient - Callback for client-side logging. mcbServer - Callback for server-side logging.
Returns
bool A value of true indicates success, otherwise false returned. The return value can generally be ignored and is provided as a means to call this method via dynamic global initialization.

Member Enumeration Documentation

◆ mcbType

Enumerator
mcbAll 
mcbClient 
mcbServer 

Constructor & Destructor Documentation

◆ XrdSsiLogger()

XrdSsiLogger::XrdSsiLogger ( )
inline

Constructor and destructor.

◆ ~XrdSsiLogger()

XrdSsiLogger::~XrdSsiLogger ( )
inline

Member Function Documentation

◆ Msg()

static void XrdSsiLogger::Msg ( const char *  pfx,
const char *  txt1,
const char *  txt2 = 0,
const char *  txt3 = 0 
)
static

Insert a space delimited error message into the log file.

Parameters
pfx!0 -> the text to prefix the message; the message is formed as <timestamp> pfx: txt1 [txt2] [txt3]
pfx =0 -> add message to the log without a time stamp or prefix.
txt1,txt2,txt3the message to be added to the log.

◆ Msgf()

static void XrdSsiLogger::Msgf ( const char *  pfx,
const char *  fmt,
  ... 
)
static

Insert a formated error message into the log file using variable args.

Parameters
pfx!0 -> the text to prefix the message; the message is formed as <timestamp> <pfx>: <formated_text>
pfx =0 -> add message to the log without a time stamp or prefix.
fmtthe message formatting template (i.e. sprintf format). Note that a newline character is always appended to the message.
...the arguments that should be used with the template. The formatted message is truncated at 2048 bytes.

◆ Msgv() [1/2]

static void XrdSsiLogger::Msgv ( const char *  pfx,
const char *  fmt,
va_list  aP 
)
static

Insert a formated error message into the log file using a va_list.

Parameters
pfx!0 -> the text to prefix the message; the message is formed as <timestamp> <pfx>: <formated_text>
pfx =0 -> add message to the log without a time stamp or prefix.
fmtthe message formatting template (i.e. sprintf format). Note that a newline character is always appended to the message.
aPthe arguments that should be used with the template. The formatted message is truncated at 2048 bytes.

◆ Msgv() [2/2]

static void XrdSsiLogger::Msgv ( struct iovec *  iovP,
int  iovN 
)
static

Insert a formated error message into the log file using a iovec.

Parameters
iovPpointer to an iovec that contains the message. that a newline character is always appended to the message.
iovNthe number of elements in the iovec.

◆ SetMCB()

static bool XrdSsiLogger::SetMCB ( MCB_t mcbP,
mcbType  mcbt = mcbAll 
)
static

◆ TBeg()

static const char * XrdSsiLogger::TBeg ( )
static

◆ TEnd()

static void XrdSsiLogger::TEnd ( )
static

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