op_prg_log_handle_create()

Abstract

Returns a handle that can be used to reference a DES log.

Syntax

op_prg_log_handle_create (category, class_name, subclass, incident_limit)
Argument Type Description
category Log_Category Type of log entry to be associated with the new log handle (see Details).
class_name const char* string describing class of log entries for this handle
You define the meaning and content of this string.
subclass const char* string describing subclass of entries for this handle
You define the meaning and content of this string.
incident_limit unsigned int maximum number of individual log entries allowed for this handle (see Details).

Return Type

Log_Handle

Log handle that can be used when calling other op_prg_log… KPs.

Example

Excerpt from: ams_atm_notif_log_support_v2.ex.c in the models/std/atm directory.

if (atm_notif_log_initialized == OPC_FALSE)
	{
	/* Set flag to prevent re-initialization. */
	atm_notif_log_initialized = OPC_TRUE;

	...
	
	/* Configuration related notification handles. */
	atm_conf_log_handle = op_prg_log_handle_create 
		(OpC_Log_Category_Configuration, "ATM", "Setup", atm_conf_log_limit);

	atm_invalid_dest_conf_log_handle = op_prg_log_handle_create
		(OpC_Log_Category_Configuration, "ATM", "Setup", atm_conf_log_limit);

	...

	}

Details

When creating discrete event simulation (DES) logs, a log handle is needed for each category of log entry to be used. The data type and defined values for category are:

Log_Category

  • OpC_Log_Category_Configuration
  • OpC_Log_Category_Protocol
  • OpC_Log_Category_Lowlevel
  • OpC_Log_Category_Results
  • OpC_Log_Category_Unknown

Note: The Unknown category produces a blank entry in the DES log.

You should use the class_name and subclass arguments to further refine the meaning of the categories as they pertain to specific modeling projects. If the log handle receives a number of identical log entries, it reports each one separately until incident_limit entries have been reported. After that, it tracks the number of times that entry is logged and reports the number of occurrences in a single log entry at the end of the simulation.

Newly created handles have a severity of PrgC_Log_Severity_Notice. You can use op_prg_log_handle_severity_set() to change the severity level before writing to the log.

Purpose

Provides a mechanism to create a log handle to use when writing DES log entries.

Errors

  • No errors are trapped.

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