LOG_MESSAGE

For OS/2 only, the LOG_MESSAGE verb records a message in the error log file and optionally displays the message on the user's screen. This verb is included for compatibility with existing applications.

The following structure describes the verb control block used by the LOG_MESSAGE verb.

struct log_message {
    unsigned short       opcode;
    unsigned char        opext;
    unsigned char        reserv2;
    unsigned short       primary_rc;
    unsigned long        secondary_rc;
    unsigned short       msg_num;
    unsigned char        origntr_id[8];
    unsigned char        msg_file_name[3];
    unsigned char        msg_act;
    unsigned short       msg_ins_len;
    unsigned char FAR * msg_ins_ptr;
};
 

Members

opcode
Supplied parameter. The verb identifying the operation code, SV_LOG_MESSAGE.
opext
A reserved field.
reserv2
A reserved field.
primary_rc
Returned parameter. Specifies the primary return code set by APPC at the completion of the verb. The valid return codes vary depending on the APPC verb issued. See Return Codes for valid error codes for this verb.
secondary_rc
Returned parameter. Specifies the secondary return code set by APPC at the completion of the verb. The valid return codes vary depending on the APPC verb issued. See Return Codes for valid error codes for this verb.
msg_num
Supplied parameter. Specifies the number of the message in the message file specified by msg_file_name.
origntr_id
Supplied parameter. Specifies the name of the component issuing LOG_MESSAGE or an 8-byte, user-supplied string.
msg_file_name
Supplied parameter. Specifies the name of the file containing the message to be logged.
msg_act
Supplied parameter. Specifies the action to be taken when processing the message:
msg_ins_len
Supplied parameter. Specifies the length of data to be inserted into the message. Set this parameter to zero if no data is to be inserted.
msg_ins_ptr
Supplied parameter. Specifies the address of the data to be inserted into the message.

Use this parameter only if msg_ins_len is greater than zero.

Return Codes

sv_ok
Primary return code; the verb executed successfully.
sv_parameter_check
Primary return code; the verb did not execute because of a parameter error.
sv_invalid_data_segment
Secondary return code; the data that was to be inserted into the message extended beyond the segment boundary.
sv_invalid_message_action
Secondary return code; the msg_act parameter contained an invalid value.
sv_comm_subsystem_not_loaded
Primary return code; a required component could not be loaded or terminated while processing the verb. Thus, communication could not take place. Contact the system administrator for corrective action.
sv_invalid_verb
Primary return code; the opcode parameter did not match the operation code of any verb. No verb executed.
sv_invalid_verb_segment
Primary return code; the VCB extended beyond the end of the data segment.
sv_unexpected_dos_error
Primary return code; one of the following conditions occurred:

Remarks

The value for msg_file_name must be three characters long. Pad with spaces if necessary. The .MSG extension is added automatically.

The total length of msg_ins_len, including header information (40 bytes), message text, and inserted data, should not exceed 256 bytes. If the length is greater than 256 bytes, the communication system will attempt to log only the header information and inserted text; the message text will be left out.

When you create the log message file, you can specify where in the message the additional data is to be inserted. Further information is provided below.

The data for msg_ins_ptr consists of a series of up to nine null-terminated strings. (Because IBM OS/2 ES version 1.0 supports only three data strings, you may want to limit the inserted text to three strings to ensure compatibility.)

Creating a Message File

If you want to create your own message file, you must use the utility MKMSGF. This utility can also run with MS-DOS.

The first three characters of the message number must match the three-character name of the log message file. These three characters are declared at the top of the file as well.

The system finds the message file as follows: