Printing to the policy log
Printing messages to the policy log is one of the most useful capabilities of Netcool®/Impact when it comes to testing and debugging policies.
You print messages to the policy log using the Log
function.
The Log
function takes the message you want to print
as its input parameter.
This example is a version of the classic "Hello, World!" program used to teach developers how to program in the C programming language. In the C version, you print Hello, World! to the standard output. You are not permitted to access the standard output stream using the policy language but you can print the message to the policy log.
The policy, which consists of a single line, is as follows.
Log("Hello, World!");
Here, you simply call the Log
function and pass
the string Hello, World
! as an input parameter. As
in programming languages like C/C+ and Java, you enclose string literals
in double quotation marks.
When you run the policy, it prints the following message to the policy log:
Hello, World!