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
- Use the KP op_prg_log_handle_create() to create a log handle
- Use the KP op_prg_log_entry_write() to write a log entry with an automatically generated time stamp
- Use the KP op_prg_log_entry_write_options() to write a log entry with selected column values omitted
- Use the KP op_prg_log_handle_severity_set() to change the severity level before writing a log entry