Share this page

# Example: lr.enable_redirection

## Example 1

In the following example the lr.enable_redirection function causes Java output and error streams to be redirected into log files and the Output window.

      lr.enable_redirection(true);
        :
        :
      System.out.println("Application running!");
        :
        :
      if ( rc != 0 )
         System.err.println("Application failed!");
        :
        :
      lr.enable_redirection(false);

## Example 2

In the following example, lr.enable_redirection directs Java output to an output stream.

    int var=100;
    lr.enable_redirection(true);
    outstr.println("The value of the variable is "+var);
    return 0;

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