The print() function sends strings it receives to each of the active logs in the Domain Manager process. There is no automatic translation of the message text. The syntax is as follows:

print(<argument>);

The value of the argument passed to the print() function can be any data type. The argument passed to a print() function is converted to a string before it is printed.

To print special characters, use the syntax listed in Print function special characters.

Table 1. Print function special characters

Character

Syntax

Notes

tab

\t

single quote (')

\'

The quotation marks surrounding the string containing this code must be double quotes.

double quote (")

\"

The quotation marks surrounding the string containing this code must be single quotes.

backward slash (\)

\\

carriage return

\r

line feed

\n

The output of the print() function is dependent on the value of the computed attribute, enableLegacyPrint, in GA_Driver. When ASL scripts are run by using sm_adapter, the enableLegacyPrint attribute is set to TRUE. In all other cases it is set to FALSE. The default value of the enableLegacyPrint attribute is FALSE.

When the enableLegacyPrint is set to FALSE, the print output includes the time, date, thread id, and ASL script. When enableLegacyPrint is set to TRUE, only the string that is sent to the print() function is printed.

You need an object handle to a GA_Driver object to set the enableLegacyPrint attribute. You can use "Null GA_Driver" which always exists.

In this example, the value of the enableLegacyPrint attribute is changed. The output of the print() function is also included.

START { } do {
 print("default");
 drv = object("GA_Driver", "Null GA_Driver");
 drv->enableLegacyPrint = FALSE ? LOG,STOP;
 print("new style");
 drv->enableLegacyPrint = TRUE ? LOG,STOP;
 print("legacy");
 stop();
}

Output for "sm_adapter --output /tmp/foo.asl" :

default
[February 6, 2009 12:19:03 AM EST +527ms] t@1088432480 main
ASL_MSG-*-ASLP-/tmp/foo.asl: new style
legacy