op_prg_log_entry_write_t()

Abstract

Writes a log entry with a specified time stamp to the specified log handle.

Syntax

op_prg_log_entry_write_t (handle, tval, entry_text, …)
Argument Type Description
handle Log_Handle Log handle identifying the simulation log to receive the entry.
tval double Simulation time to be recorded in the log entry (in seconds).
entry_text const char* String containing the text of the log entry. The string can contain conversion specifiers like those used by the C printf command (%d, %s, and so on).
… various Zero or more arguments representing values to be substituted into entry_text.

Return Type

void

No return value.

Example

/* Write a pre-sim message to the log	*/
op_prg_log_entry_write_t (sim_log_handle, 0.0,
	"Duplicate IP addr (%s) found.\n", ip_addr_str);

Details

This KP appends a new log entry to a simulation log. Simulation logs can only be referenced by variables of type Log_Handle that have been initialized with op_prg_log_handle_create().

You can specify the value for the Time column with tval.

Purpose

Provides a mechanism to write an entry to a specified simulation log. This KP is identical to op_prg_log_entry_write(), except that it also lets you specify the simulation time to be included in the log entry.

Errors

  • Recoverable Error: Invalid log handle.
  • Recoverable Error: Nil handle format.
  • Program Abort: Segmentation violation/Bus error. (due to an invalid argument following a string with conversion specifiers)

Reference

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