Develop > WebSphere Commerce development environment > Enhancements to working with OpenLaszlo files


Trace an OpenLaszlo build

A stack trace shows which methods and handlers are called while the application is running.

You can enable the debug console when OpenLaszlo applications are running. When the debug console is enabled, an OpenLaszlo application logs information to the console. For example all warning or error messages, when the application is running, are logged.

The debug console provides shows all logged messages. Use this information to view the associated stack trace.

To enable tracing, see Accept OpenLaszlo applications.

Click any warning, error, or debug messages, logged in the debug console, displays extra information including a backtrace. The backtrace shows the method calls that lead to the logged message. In this example, a debug message is printed from Service.lzx line 1165:

When you click the backtrace link, the methods that led to the debug message are printed.

The backtrace option is also available not only for debugging but also for error and warning messages. Click an error message to see the backtrace of what caused the error.

When adding debug messages to the code, use the Debug.debug() method to print messages instead of the Debug.write() method. This method ensures that the messages contain a backtrace. Calls to Debug.debug() can appear inside handlers, methods, and attribute setter methods.


Related tasks

Work with OpenLaszlo files

Accept OpenLaszlo applications

Changing OpenLaszlo compiler properties

Changing key mapping for OpenLaszlo actions


+

Search Tips   |   Advanced Search