×

Please give details of the problem

Skip to content

Running an application in Debug mode

This document discusses the debugging capabilities within RunMyProcess.

1 Overview

When there is an error in an application, running the application in debug mode will provide detailed information regarding the JavaScript execution. This information can help to identify the location and cause of the error.

2 Running an application in Debug Mode

2.1 Switching to debug mode

Adding the P_attributes=debug parameter to the application's URL will enable debug mode.

For example:

If the URl of an application in TEST is https://live.runmyprocess.com/live/P_customer/appli/133163?P_mode=TEST;
the URl of the application in TEST in Debug mode is https://live.runmyprocess.com/live/P_customer/appli/133163?P_mode=TEST&P_attributes=debug

2.2 Instrumenting JavaScript Objects

Adding instrumentation calls to your JavaScript will enable you to follow the execution flow and gain essential information regarding the application logic.

Two methods are available for facilitating instrumentation:

Examples

1 Example of the use of the debugable method.
function Foo(){
    Foo.prototype.bar = function(arg1, arg2){
    // Here the code of the method
    }
}
var foo = new Foo();
RMPApplication.debugable('foo');
foo.bar("param1", "param2");    

In debug mode, the browser console will display :

12:02:50,296 debugable foo  
12:02:50,309 foo.bar(param1, param2) - start
12:02:50,311 foo.bar - end
2 Example of the use of the debug method
RMPApplication.debug('i was here');    

In debug mode, the console will display :

12:02:50,305 i was here

Advantages of Instrumentation

  • Instrumentation has no impact when NOT in debug mode;
  • Chronometer for all instrumented methods;
  • Log of all intrumented methods calls;
  • Parameters are logged;
  • Easy to use.