ACC Utilities Reference Guide
ZMLOG - Diagnostic Message Logging
ZCOM Diagnostic Message Logging Mechanism
Chapter 6160
$(1) Message 1 of PROGX (not progx).
$(2)$ Message 2 of PROGX (not progx).
In the preceding example, error message “Test Error Message on
Channel, int(%1$d)” is assigned to error message 3, from program progx.
Error message 3 has a priority of 2. Note that each error message can
have zero or more variables. For instance, error message 25 is composed
of text plus 2 variables. The first variable (1$) takes on a character string
format, and the second variable (2$) takes on an integer format.
Each message has a priority level of -128 to 127. By assigning different
priority levels and using the -p option in ZMLOG, unwanted messages
can be filtered out by ZMLOG. See the above description on the -p option.
There is no imposed restrictions on how to assign priority level, but the
general guidelines is that lower values for informative or unimportant
messages, larger values for more important messages. For output
alignment purpose, it is recommended to use single digit priority values,
i.e. 0 to 9.
Application Generated Messages
The ZCOM error logging mechanism allows application programs to
inject their own messages into the ZCOM logging stream. This allows the
relative timing of ZCOM and application messages to be preserved.
Two functions, zcomlname and zcomlog, are provided to facilitate this
service. The zcomlog routine writes to the special device file /dev/zmlog,
which sends the messages to the LDM driver.
Function zcomlname is used to register the error logging name. The
name passed in this call must be 5 characters or less, and must
correspond to the name following the keyword $NAME in the text file.
Usually this name either matches, or is derived from the name of the
program itself.
Function zcomlog generates and passes a message to the logging system.
It passes an error number and a message number, as well as the number
and the list of the variables. The message number is used to reference
the message in the message file. The error number is displayed with the
message. It is recommended that the error number and the message
number are the same.
The following example illustrates how a program may use these calls:










