![]() | Programming Guide | ![]() |
Controls error log processing
#include <tmusubs.h>int sm_tm_errorlog(int call_type, int call_type_code, char *log_file);
call_type- 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.call_type_code- A value that is used depending on the argument supplied for
call_type.log_file- The name of the file in which the error log is maintained; ignored unless
call_typeisTM_ERR_FILE.
- 0 Success.
sm_tm_errorlogcontrols error log processing according to the value ofcall_type.
TM_ERR_KEEPspecifies the existence of the error log. Acall_type_codevalue 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_SUPPRESSspecifies which errors to suppress depending on a severity level, wherecall_type_codedetermines which errors to suppress. Any errors passed to sm_tm_error with a severity greater than 0 and less than or equal tocall_type_codeare not logged. Ifcall_type_codeis 0, there is no suppression.
TM_ERR_FILEspecifies the error log file that is named bylog_file. The file is appended to if it exists, but a call to this function withTM_ERR_KEEPmight override this. If there is no call tosm_tm_errorlog, there is no sm_tm_error error logging.If
call_type_codeis 0, the file is not flushed or closed unnecessarily after it is written to. Ifcall_type_codeis 1, the file is closed after each entry is written.If
log_fileis a null pointer or empty string, there is no further error logging until a subsequent call tosm_tm_errorlogreinstates it.
TM_ERR_NEW_COMMANDspecifies that processing of a new command is starting.