demo/c/socket/LogRedirect.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for LogRedirect.c:

Go to the source code of this file.

Functions

static void myLogger (void *logUserP, XMLBLASTER_LOG_LEVEL currLevel, XMLBLASTER_LOG_LEVEL level, char *location, char *fmt,...)
 Customized logging output is handled by this method.
static int myUpdate (MsgUnitArr *msgUnitArr, void *userData, XmlBlasterException *xmlBlasterException)
 Here we receive the callback messages from xmlBlaster.
int main (int argc, char **argv)
 Invoke: LogRedirect -logLevel TRACE.


Function Documentation

int main ( int  argc,
char **  argv 
)

Invoke: LogRedirect -logLevel TRACE.

Definition at line 30 of file LogRedirect.c.

References XmlBlasterAccessUnparsed::connect, XmlBlasterAccessUnparsed::disconnect, ExceptionStruct::errorCode, freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), getXmlBlasterVersion(), XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, myLogger(), myUpdate(), XmlBlasterAccessUnparsed::ping, XMLBLASTER_MAX_USAGE_LEN, xmlBlasterAccessUnparsedUsage(), and xmlBlasterFree().

Here is the call graph for this function:

static void myLogger ( void *  logUserP,
XMLBLASTER_LOG_LEVEL  currLevel,
XMLBLASTER_LOG_LEVEL  level,
char *  location,
char *  fmt,
  ... 
) [static]

Customized logging output is handled by this method.

We register this function with

 xa->log = myLogger;
 
Parameters:
logUserP 0 or pointing to one of your supplied data struct
currLevel The actual log level of the client
level The level of this log entry
location A string describing the code place
fmt The formatting string
... Other variables to log, corresponds to 'fmt'
See also:
xmlBlaster/src/c/msgUtil.c: xmlBlasterDefaultLogging() is the default implementation

Definition at line 125 of file LogRedirect.c.

References getLogLevelStr(), VSNPRINTF, and XMLBLASTER_LOG_TRACE.

Here is the call graph for this function:

static int myUpdate ( MsgUnitArr msgUnitArr,
void *  userData,
XmlBlasterException xmlBlasterException 
) [static]

Here we receive the callback messages from xmlBlaster.

Definition at line 172 of file LogRedirect.c.

References MsgUnitStructArr::len, messageUnitToXml(), MsgUnitStructArr::msgUnitArr, MsgUnit::responseQos, strcpyAlloc(), and xmlBlasterFree().

Here is the call graph for this function: