msg_get_severity()
Get severity information for a message.
Syntax
msg_get_severity(message_ID)
Parameter
Parameter | Definition |
---|---|
message_ID | integer that identifies a message whose severity you want to retrieve |
Description
The msg_get_severity() function returns an integer that indicates the severity of a message. This function gets the severity from the message catalog, which stores a severity for each message. The following list shows return values for msg_get_severity().
Return Value | Description |
---|---|
1 | INFO |
2 | WARNING |
3 | ERROR |
4 | FATAL |
-1 | could not retrieve severity |
Example
The following example shows a sample message catalog:
VENDOR_ID 1
VENDOR BMC Software
TOOL_ID 23
TOOL PATROL Demo
VERSION 1.0
DATE 13-Mar-1997
#----------------------------------------------------
ID 2 DEMO_GREET INFO CURRENT
MESSAGE "G'Day %s, how's your %s?\n"
VENDOR BMC Software
TOOL_ID 23
TOOL PATROL Demo
VERSION 1.0
DATE 13-Mar-1997
#----------------------------------------------------
ID 2 DEMO_GREET INFO CURRENT
MESSAGE "G'Day %s, how's your %s?\n"
The following example of the msg_get_severity() function uses the preceding message catalog:
print("Severity=", msg_get_severity(DEMO_GREET));
The previous command produce the following output:
Severity=1
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*