LG_Collect

LG_Collect — specifies when a line of data is considered complete.

Syntax

#include <cogent.h>
ST_STATUS LG_Collect(IP_Task*  myself,
 IP_Task*  textlog,
 char*  retbuf,
 int  buflen,
 char*  style,
 int  nlabels,
 char**  labels);

Arguments

myself

A pointer to this task's IP_Task structure normallly generated by a call to IP_NserveInit.

textlog

A pointer to the Cascade TextLogger's IP_Task structure, normally generated by a call to IP_TaskFindName.

retbuf

A pointer to a character buffer to hold the return from the call.

buflen

The length of retbuf, in bytes.

style

One of the following:

any

Writes a line when data from any point is eligible to be written. Leaves values for all other points empty.

fill

Writes a line when data from any point is eligible to be written. Writes previous values for all other points.

all

Writes a line only after data from all points is eligible to be written.

nlabels

The number of labels (log or group names) referenced in the labels argument.

labels

An array of char*, each of which is a pointer to a string containing a log or group name.

Returns

ST_OK on success. Otherwise ST_ERROR, and the retbuf will contain a more detailed error message (see collect in the Cascade TextLogger documentation). If the return value is ST_OK, the retbuf may not contain useful information.

Description

This function lets you specify when a line of data in a given log or group is considered complete, and ready for writing. If no labels are specified, this command sets a global default value for all logs and groups. Any specific value always overrides the global definition, regardless of the order in the configuration file or when a command is sent.

The Cascade TextLogger always keeps one line of output for each log in a buffer. Whenever a point changes value, the TextLogger checks each log to see if it includes that point. If so, the TextLogger checks the style specified for the log. If it is any or fill and if the tolerance for that log has been exceeded, the line in the buffer gets written immediately, and this point is entered in a new line in the buffer. But if the style is set to all, the TextLogger keeps the line in the buffer until every point in the log has changed at least once, or until a point is logged beyond the tolerance. When one of these conditions is met, the line gets written.

This function corresponds to the Cascade TextLogger collect command.