Share this page

# lr_output_message

Sends a message to log files, output windows, and other test report summaries.

    int lr_output_message( char *format, exp1, exp2,...expn.);

Alphabetical Listing - C Language Utility Functions

## Arguments

Name | Comments
--- | ---
format C Language | A formatted string. If it is a literal string, enclose it with quotation marks. Use the standard Message Formatting that is available for printf to set the format for the expressions you want to print.
exp1, exp2,.. expn C Language | The expressions (variables) to be formatted and printed.
message Object Oriented | A string containing the message to send to the Output window. See Java String Arguments.

The lr_output_message function sends a message with the script section and line number to output windows, log files, and other test report summaries.

For details regarding the output for each product, see the products' user guides.

When a script is run in VuGen, the output file is output.txt.

Note:

- The output message will be trimmed if the message size is greater than 5 KB.
- The output message is always displayed in the output window, regardless of whether Enable logging in the runtime settings is checked or unchecked.

To send an error message to the output window , use the lr_error_message function. It is not recommended that you send a message to the output window or agent log in the middle of a transaction, as it will lengthen the execution time. To send a message to the log but not to the Output window, use lr_log_message.

To issue a message without including the location details, use lr_message.

#### statement | #### Output
--- | ---
lr.log_message("a message") | a message
lr.output_message("a message"); | Actions.java (4): a message

Note: Do not send null pointers as arguments to string formats e.g.
char *str = NULL;
lr_output_message("%s", str);

## Return Values

If this function succeeds, it returns the length of the message that was sent. If the function fails, it returns a negative number.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

See Also

## Example

In this example, an `Iteration Number` type parameter called `"iteration`" was defined in VuGen. The lr_output_message function sends a message to Controller indicating the current iteration number.

    lr_output_message( "We are on iteration #%s", lr_eval_string( "{iteration}" ) );

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: