Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor
219 views

(SM) Support Tip: Debugging another session running on web client, while not having access to logs

Debugging another session i.e. running in background or on web client, while not having access to log file.

 

On occasions, it may be necessary to debug a background, integration, or user session for which you do not have access to log files.

The following debugging code works like a print into the message pane of another user.

This can also be used for background processes and integration sessions as well:

 

 

  /* Print logging message to console. Especially useful for logging background message.

  *

  * @input parameters:  message, operator

  * @return value:      none

  * @example:

    Call the function from JS:           

            lib.SimpleDebugging.printMessage("haha you are here", "falcon");

            lib.SimpleDebugging.printMessageToMe("haha you are here");

            lib.SimpleDebugging.printAnythingToMe();

      Call the function from Expressions of e.g. link, Process, displayoption etc.:

            $L.void=jscall("SimpleDebugging.printMessage", "haha you are here", "falcon");

 

      Note falcon is only a place holder, replace it by a valid operator

  *

  */

 

function printMessage(message,operator){

      var a;

      var arrayOfUser = new Array();

      arrayOfUser.push(operator);

      var d = system.functions.rtecall("msg", a, message, 1, arrayOfUser);

}

 

// This function prints the input message to the hard-coded operator

function printMessageToMe(message){

      var a;

      var arrayOfUser = new Array();

      arrayOfUser.push("<OOB operator>");

      var d = system.functions.rtecall("msg", a, message, 1, arrayOfUser);

}

 

// This function prints the current time stamp to the hard-coded operator

function printAnythingToMe(){

      var a;

      var arrayOfUser = new Array();

      arrayOfUser.push("<OOB operator>");

      var d = system.functions.rtecall("msg", a, system.functions.tod().toString(), 1, arrayOfUser);

}

 

//lib.SimpleDebugging.printMessage("haha you are here", "<OOB Operator>");

 

 

Usage example:

This example documents example on the Format Control record login.DEFAULT  - Calculation

Add:true      Calculation:  $r=jscall("SimpleDebugging.printMessage", "$G.cilevel : "+str($G.cilevel), "falcon")

 

 

NOTE: Please use care and caution with the “…ToMe()” functions as this hard codes the message receiver.

 

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.