Programming Guide


Controls error log processing

#include <tmusubs.h>
int sm_tm_errorlog(int call_type, int call_type_code, char *log_file);

Determines which aspect of error log processing is affected. One of the following constants: TM_ERR_KEEP, TM_ERR_SUPPRESS, TM_ERR_FILE, TM_ERR_NEW_COMMAND, as defined below.

A value that is used depending on the argument supplied for call_type.

The name of the file in which the error log is maintained; ignored unless call_type is TM_ERR_FILE.



sm_tm_errorlog controls error log processing according to the value of call_type.

TM_ERR_KEEP specifies the existence of the error log. A call_type_code value of 0 clears the error log when a new command begins processing. A value of 1 indicates not to clear out the log. The last parameter is ignored.

TM_ERR_SUPPRESS specifies which errors to suppress depending on a severity level, where call_type_code determines which errors to suppress. Any errors passed to sm_tm_error with a severity greater than 0 and less than or equal to call_type_code are not logged. If call_type_code is 0, there is no suppression.

TM_ERR_FILE specifies the error log file that is named by log_file. The file is appended to if it exists, but a call to this function with TM_ERR_KEEP might override this. If there is no call to sm_tm_errorlog, there is no sm_tm_error error logging.

If call_type_code is 0, the file is not flushed or closed unnecessarily after it is written to. If call_type_code is 1, the file is closed after each entry is written.

If log_file is a null pointer or empty string, there is no further error logging until a subsequent call to sm_tm_errorlog reinstates it.

TM_ERR_NEW_COMMAND specifies that processing of a new command is starting.

See Also