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_type
isTM_ERR_FILE
.
- 0 Success.
sm_tm_errorlog
controls error log processing according to the value ofcall_type
.
TM_ERR_KEEP
specifies the existence of the error log. Acall_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, wherecall_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 tocall_type_code
are not logged. Ifcall_type_code
is 0, there is no suppression.
TM_ERR_FILE
specifies 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_KEEP
might override this. If there is no call tosm_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. Ifcall_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 tosm_tm_errorlog
reinstates it.
TM_ERR_NEW_COMMAND
specifies that processing of a new command is starting.