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.

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().

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com