ImexT_Log_Proc
Abstract
Callback: Called to log errors discovered in the input text file during import.
Syntax
<log_proc_name> (package, severity_str, line, message)
| Argument | Type | Description |
|---|---|---|
package |
const char * |
Package name of functions in which the error occurred |
severity_str |
const char * |
String indicating the severity level of the error, either “None”, “Critical”, “Non-Critical”, or “Warning” |
line |
int |
Line number at which the error occurred in the import file |
message |
const char * |
Message providing a description of the error |
Return Type
int
Result code.
Header
imex.h
Details
This callback can be used to perform some custom processing when error messages are to be logged. It is registered by Imex_Topo_Import_Logged() and Imex_Traf_Import_Logged().
A sample procedure follows:
int
my_log_proc (const char *package, const char *severity_str,
int line, const char *message)
{
char buffer [1024];
int retval = 0;
FIN (my_log_proc);
/* Format the line number and error message information and place */
/* in a character buffer */
snprintf (buffer, 1024, "%s at line %d", message, line);
/* Call ETS function to log error message to the tool and to a file */
Ets_Msg_Info_Logged (NULL, package, severity, buffer);
/* return default 0 if nothing goes wrong */
FRET (retval);
}
For another example, see the default code at Imex_Default_Log_Proc_Get().