Next: logDaemon Reference
Up: APS logDaemon and Client
Previous: logDaemon Overview
#include logDaemonLib.h
logOpen
int logOpen(LOGHANDLE *h, char *serviceId, char *sourceId, char *tagList);
Open a connection with the logDaemon (not in TCP sense, though, since library is UDP based). User must provide a ptr to a pre-allocated LOGHANDLE. The sourceId is an arbitrary string up to 250 chars in length. The serviceId ptr may be NULL, in which case the default logDaemon is contacted. Otherwise, serviceId is an arbitrary string up to 255 chars in length. The tagList is a space delimited set of tag names. Tag names may not have spaces in them. Each tag name may be up to 255 chars in length.
- h - ptr to pre-allocated LOGHANDLE struct
- sourceId - ptr to null terminated string up to 250 chars in length
- serviceId - NULL, or ptr to null terminated string up to 255 chars in length.
- tagList - ptr to null terminated string. Total length limited by UDP packet size, but each space delimited tag name may be no longer than 255 chars.
Returns:
- LOG_OK - connection opened, sourceId and tagList validated
- LOG_TOOBIG - one of the strings supplied is too long
- LOG_ERROR - unable to open connection to logDaemon
- LOG_INVALID - logDaemon rejected given sourceId and tagList
logString
int logString(LOGHANDLE h, char *valueList);
Sends a log message to the logDaemon. The message is time-stamped with secs and usecs past UNIX epoch automatically. The remaining data comes from valueList, a space delimited string of tag values. There must be a value supplied for each tag defined by the logOpen() call. If a tag value has internal spaces, you must double quote the full value. Ie. ``val1 ``val2 with spaces'' val3''. The valueList has no size limit other than that imposed by the UDP packet size.
- h - LOGHANDLE from logOpen() call
- valueList - ptr to null terminated string of space delimited tag values.
Returns:
- LOG_OK - message logged
- LOG_TOOBIG - the valueList string supplied takes packet over UDP size limit.
- LOG_ERROR - unable to send message to logDaemon
logArguments
int logArguments(LOGHANDLE h, ...);
Sends a log message to the logDaemon. The message is time-stamped with secs and usecs past UNIX epoch automatically. The remaining data comes from a series of (char *) arguments, the last of which must be NULL. Ie. logArguments(h, ``val1'', ``val2'', NULL); There must be a value supplied for each tag defined by the logOpen() call.
- h - LOGHANDLE from logOpen() call
- ... - series of (char *) arguments. The last argument must be NULL.
Returns:
- LOG_OK - message logged
- LOG_TOOBIG - the total length of tag values takes packet over UDP size limit.
- LOG_ERROR - unable to send message to logDaemon
logArray
int logArray(LOGHANDLE h, char *valueArray[]);
Sends a log message to the logDaemon. The message is time-stamped with secs and usecs past UNIX epoch automatically. The remaining data comes from valueArray, an array of pointers to null terminated value strings. The last element of the array must be NULL. Ie. val[0] = ``this''; val[1] = ``that'' ; val[2] = NULL; logArray(h, val). There must be a value supplied for each tag defined by the logOpen() call.
- h - LOGHANDLE from logOpen() call
- valueArray - array of pointers to null terminated strings, last element is NULL
Returns:
- LOG_OK - message logged
- LOG_TOOBIG - the total length of tag values takes packet over UDP size limit.
- LOG_ERROR - unable to send message to logDaemon
logClose
int logClose(LOGHANDLE h);
Close up logDaemon ``connection''. LOGHANDLE may be reused after closing.
- h - LOGHANDLE from logOpen() call
Returns:
- LOG_OK - connection closed
Next: logDaemon Reference
Up: APS logDaemon and Client
Previous: logDaemon Overview
Robert Soliday
2005-05-02