op_prg_log_entry_write()

摘要

向指定的日志句柄写入一条日志条目。

语法

op_prg_log_entry_write (handle, entry_text, …)
参数 类型 说明
handle Log_Handle 标识接收该条目的仿真日志的日志句柄。
entry_text const char* 包含日志条目文本的字符串。该字符串可以包含类似 C 语言 printf 命令使用的转换说明符(%d、%s 等)。
… various 零个或多个参数,表示要替换到 entry_text 中的值。

返回类型

void

无返回值。

示例

节选自 models/std/atm 目录中的 ams_atm_notif_log_support_v2.ex.c。

/* Write the message to the notification log	*/
op_prg_log_entry_write (atm_buff_overflow_cell_loss_log_handle,
	"SYMPTOM(S):\n"
	" A Cell is being dropped as there is  \n"
	" no available space at output  buffer \n"
	" of port [%d] for the QoS %s          \n"	
	"\n"
	"CAUSE(S):\n"
	" Cells can be dropped at the end nodes\n"
	" or switches due to non-availability  \n"
	" of buffer space at the output ports. \n"
	" The buffers need to be sufficient    \n"
	" to hold cells generated due to a     \n"
	" burst.                               \n"
	"\n"
	"SUGGESTION(S):\n"
	" 1. Set the buffer sizes for QoS      \n"
	" %s to be greater than                \n"
	" the present value of %d.             \n"
	"\n",
	port_value,
	qos_string,
	qos_string,
	cur_buf_size
	);

详情

该内核过程向仿真日志追加一条新的日志条目。日志条目将带有基于生成该条目的事件的仿真时间的时间戳。

仿真日志只能由类型为 Log_Handle 且已通过 op_prg_log_handle_create() 初始化的变量引用。

用途

提供一种向指定仿真日志写入条目的机制。

错误

  • 可恢复错误:日志句柄无效。
  • 可恢复错误:空句柄格式。
  • 程序中止:段错误/总线错误。(由于跟在带转换说明符的字符串之后的参数无效)

参考

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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