#include <cogent.h>
ST_STATUS LG_File(
IP_Task* myself, IP_Task* textlog, char* retbuf, int buflen, char* filename, int nlabels, char** labels )
;
A pointer to this task's IP_Task structure normallly generated by a call to IP_NserveInit.
A pointer to the Cascade TextLogger's IP_Task structure, normally generated by a call to IP_TaskFindName.
A pointer to a character buffer to hold the return from the call.
The length of retbuf, in bytes.
One of the following:
The name of the file that will be logged to.
stdout
stderr
The number of labels (log or group names) referenced in the labels argument.
An array of char*, each of which is a pointer to a string containing a log or group name.
ST_OK on success. Otherwise ST_ERROR, and the retbuf will contain a more detailed error message (see file in the Cascade TextLogger documentation). If the return value is ST_OK, the retbuf may not contain useful information.
This function lets you specify the filename that a log or group will be written to. 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.
If this command specifies multiple labels, the logs for all of them will be written to one file. They will not necessarily always be written in exact time-sequential order, however. You may have to post-process the file if you need that kind of record.
The Cascade TextLogger writes each log only once. If you apply the LG_File function twice for the same log, writing to a different file each time, for example, only the most recent application of LG_File will produce results. Thus, if you need the same information written in two places, make two identical logs with different labels. |
This function corresponds to the Cascade TextLogger file command.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.