Debug messages in RPE


In many occasions it is useful to output debug messages at run-time. The debug messages can range from simple “I am here” to data dumps.

 java.lang.System.out.println( "I am here");

// your code here ...

For the final version however having these message output in the log can be annoying and even slow down the document generation. To avoid that I recommend using a template variable to control if messages are to be logged or not.  So the above code becomes:

if ( debug == "true")
{
java.lang.System.out.println( "I am here");
}

// your code here ...

Now you can toggle the debug message on/off by changing the variable’s value.

Advertisements

Author: Dragos Cojocari

Architect for Rational Publishing Engine

5 thoughts on “Debug messages in RPE”

  1. Hi Dragos,

    Where is the usual place to put in JavaScript debug messages? This is what I am currently using:

    Data -> Edit Condition -> Script Expression

    Thanks.

      1. Sorry, not sure what you meant by JavaScript code block… Could you show me how to do that on RPE 1.2? Thank you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s