#include "cgeneral.h"
#include <stdarg.h>
#include <stdio.h>
Typedefs | |
typedef TBoolean( | JpmcdsErrCallBackFunc )(char *string, void *callBackData) |
Functions | |
void | JpmcdsErrMsg (char *format,...) |
Writes an error message with a variable number of arguments to a log file. | |
void | JpmcdsErrMsgV (char *format, va_list args) |
Same as JpmcdsErrMsg but using va_list for its arguments. | |
void | JpmcdsErrLogWrite (char *message) |
Writes an error message to a log file. | |
void | JpmcdsErrMsgOn (void) |
Tells JpmcdsErrMsg to actually write something. | |
void | JpmcdsErrMsgOff (void) |
Tells JpmcdsErrMsg NOT to actually write something. | |
int | JpmcdsErrMsgFailure (char *routine) |
int | JpmcdsErrMsgFlush (void) |
Flushes the err message stream. | |
EXPORT TBoolean | JpmcdsErrMsgStatus (void) |
Returns the current logging state. | |
EXPORT int | JpmcdsErrMsgFileName (char *fileName, TBoolean append) |
Tells JpmcdsErrMsg to write to the provided file name. | |
EXPORT char * | JpmcdsErrMsgGetFileName (void) |
Returns pointer to privately held error log file name which was set by JpmcdsErrMsgFileName. | |
EXPORT char ** | JpmcdsErrGetMsgRecord (void) |
Turns on the error message record facility. | |
EXPORT int | JpmcdsErrMsgEnableRecord (int numberOfMessages, int messageSize) |
Turns on the error message record facility. | |
EXPORT int | JpmcdsErrMsgDisableRecord (void) |
Turns off the error message record facility. | |
TBoolean | JpmcdsErrMsgRecordEnabled (void) |
Returns whether the error message record has been enabled. | |
EXPORT void | JpmcdsErrMsgAddCallback (JpmcdsErrCallBackFunc *userFunc, TBoolean sendTimeStamp, void *callbackData) |
Allows the user to supply a callback for error handling. | |
EXPORT void | JpmcdsErrMsgGetCallback (JpmcdsErrCallBackFunc **userFunc, TBoolean *sendTimeStamp, void **callBackData) |
Returns callback information currently in use. |
typedef TBoolean( JpmcdsErrCallBackFunc)(char *string, void *callBackData) |
Error callback function
void JpmcdsErrMsg | ( | char * | format, | |
... | ||||
) |
Writes an error message with a variable number of arguments to a log file.
EXPORT void JpmcdsErrMsgAddCallback | ( | JpmcdsErrCallBackFunc * | userFunc, | |
TBoolean | sendTimeStamp, | |||
void * | callbackData | |||
) |
Allows the user to supply a callback for error handling.
After you add a callback, then any call to JpmcdsErrMsg which would otherwise result in a message being written to file (not that if error messaging is off then messages are not being written to file) will first invoke a call to the callback routine.
The callback routine returns TRUE to indicate that the message should still be logged to file, and FALSE to indicate that the message should not be logged to file.
The callbackData provided in this function call will be made available to the callback routine.
int JpmcdsErrMsgFailure | ( | char * | routine | ) |
Writes the message "%s: Failed.\n" to the error log and returns FAILURE. This is to enable a single function call on failing within a function as follows: return (JpmcdsErrMsgFailure (routine));
EXPORT int JpmcdsErrMsgFileName | ( | char * | fileName, | |
TBoolean | append | |||
) |
Tells JpmcdsErrMsg to write to the provided file name.
Routine opens the file, and returns SUCCESS or FAILURE depending on whether the file was successfully opened or not.
int JpmcdsErrMsgFlush | ( | void | ) |
Flushes the err message stream.
This can be called from within a debugger to make sure that the latest output written to the error log is flushed.
void JpmcdsErrMsgOff | ( | void | ) |
Tells JpmcdsErrMsg NOT to actually write something.
Tells JpmcdsErrMsg NOT to actually write something (either to log file, or to standard out, depending on how USE_PRINTF is set.)
void JpmcdsErrMsgOn | ( | void | ) |
Tells JpmcdsErrMsg to actually write something.
Tells JpmcdsErrMsg to actually write something (either to log file, or to standard out, depending on how USE_PRINTF is set.)
TBoolean JpmcdsErrMsgRecordEnabled | ( | void | ) |
Returns whether the error message record has been enabled.
Effectively error message record is enabled via the add-in function ErrorLog(1) and disabled by ErrorLog(0).
Thus we can use this function to determine in a pure add-in based interface whether the user has requested error logging.
This enables a special interface error handler to determine whether the user has requested a full error log.