No Matches
XrdSysLogPI.hh File Reference
#include <cstdlib>
#include <sys/time.h>
Include dependency graph for XrdSysLogPI.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


typedef void(* XrdSysLogPI_t) (struct timeval const &mtime, unsigned long tID, const char *msg, int mlen)
typedef XrdSysLogPI_t(* XrdSysLogPInit_t) (const char *cfgn, char **argv, int argc)

Typedef Documentation

◆ XrdSysLogPI_t

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

This header file defines the plugin interface used by the logging subsystem. The following function is called for each message. A pointer to the function is returned by XrdSysLogPInit(); see the definition below. The log message function must be thread safe in synchronous mode as any number of threads may call it at the same time. In async mode, only one thread invokes the function for each message.

mtimeThe time the message was generated. The time value is zero when tID is zero (see below).
tIDThe thread ID that issued the message (Linux -> gettid()). If tID is zero then the msg was captured from stderr.
msgPointer to the null-terminaed message text.
mlenLength of the message text (exclusive of null byte).

◆ XrdSysLogPInit_t

typedef XrdSysLogPI_t(* XrdSysLogPInit_t) (const char *cfgn, char **argv, int argc)

Initialize and return a pointer to the plugin. This function must reside in the plugin shared library as an extern "C" function. The shared library is library identified by the "-l @library" command line option. This function is called only once during loging initialization.

cfgn-> Configuration filename (nil if none).
argv-> command line arguments after "-+xrdlog".
argcnumber of command line arguments in argv.
Upon success a pointer of type XrdSysLogPI_t which is the function that handles log messages (see above). Upon failure, a nil pointer should be returned. A sample deinition is shown below.

extern "C" XrdSysLogPI_t XrdSysLogPInit(const char *cfgn, char **argv, int argc) { . . . }