Next: Some Simple Examples
Up: Logging Client API
Previous: C++ interface
C interfaces of logging clients can be used through a new data type
cmlog_client_t. Any programs that wish to log messages to the server
have to create a handler of type cmlog_client_t. All subsequent calls use
the handle to log messages.
- cmlog_client_t cmlog_open (char* progname)
- Description
Establish network connection to the client daemon. It
returns 0 if there is no connection established.
- void cmlog_close (cmlog_client_t handle)
- Description
Close network connection.
- int cmlog_logmsg (cmlog_client_t handle, int verbosity,
int severity, int code, char* facility,
char* format, ...)
- Description
Log messages with given verbosity, severity, code,
and facility. The format string must be in the form of
tagged items.
- int cmlog_logtext (cmlog_client_t handle, char* format, ...)
- Description
Log messages described with the format string.
The format string must be in the form of
tagged items.
- int cmlog_logtextI (cmlog_client_t handle, char* format,
int arg0-9)
- Description
A special routine for ISR of vxWorks.
- int cmlog_logmsgI (cmlog_client_t handle, int verbosity,
int severity, int code, char* facility,
char* format, int arg0-5)
- Description
A special routine for ISRs of vxWorks.
- int cmlog_set_severity_threshold (cmlog_client_t handle,
int threshold)
- Description
Set severity threshold for all messages. Any messages with
severity smaller than threshold will not be logged.
- int cmlog_get_severity_threshold (cmlog_client_t handle,
int* threshold)
- Description
Get severity threshold for all messages.
- int cmlog_set_verbosity_threshold (cmlog_client_t handle,
int threshold)
- Description
Set verbosity threshold for all messages. Any messages with
verbosity greater than threshold will not be logged.
- int cmlog_get_verbosity_threshold (cmlog_client_t handle,
int *threshold)
- Description
Get verbosity threshold for all messages.
- int cmlog_set_throttle (cmlog_client_t handle,
char* tag, int valuerange,
int limit, double dt)
- Description
This routine is used to set throttling on a particular
tag. After this routine has been called, only 'limit'
number of messages will be logged within time interval
'dt'. The 'size' is size of the list holding all throttled
messages. It return CMLOG_SUCCESS or CMLOG_ERROR. Note a
subsequent this call overrides previous call. In addition
number of dropped messages is saved in the subsequent
messages using a tag of ``dropped''.
- int cmlog_get_throttle (cmlog_client_t handle,
char** tag, int *valuerange,
int *limit, double *interval)
- Description
This routine is used to get throttling parameters. It
returns CMLOG_SUCCESS if there is a throttling on a
particular tag (Callers should free tag after using it).
It returns CMLOG_ERROR if there is no throttling.
Next: Some Simple Examples
Up: Logging Client API
Previous: C++ interface
Jie chen
2001-07-25