#include <cstdlib>
#include <sys/time.h>
Go to the source code of this file.
◆ 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.
- Parameters
-
mtime | The time the message was generated. The time value is zero when tID is zero (see below). |
tID | The thread ID that issued the message (Linux -> gettid()). If tID is zero then the msg was captured from stderr. |
msg | Pointer to the null-terminaed message text. |
mlen | Length 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.
- Parameters
-
cfgn | -> Configuration filename (nil if none). |
argv | -> command line arguments after "-+xrdlog". |
argc | number of command line arguments in argv. |
- Returns
- 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) { . . . }