ImexT_Log_Proc

摘要

回调:用于记录导入过程中在输入文本文件中发现的错误。

语法

<log_proc_name> (package, severity_str, line, message)
参数 类型 说明
package const char * 发生错误的函数所属的包名
severity_str const char * 指示错误严重级别的字符串,取值为 “None”、“Critical”、“Non-Critical” 或 “Warning”
line int 错误在导入文件中发生的行号
message const char * 描述该错误的消息

返回类型

int

结果代码。

头文件

imex.h

详情

此回调可用于在记录错误消息时执行某些自定义处理。它由 Imex_Topo_Import_Logged() 和 Imex_Traf_Import_Logged() 注册。

示例过程如下:

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);
	}

另一个示例参见 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