JSUtil - logObject(Object obj, String name)

Logs all the properties in the given object: name, type, and value.

Output is written to the console if you are running from a background script or have debug logging enables. The output is also written to the system log.

Table 1. Parameters
Name Type Description
obj Object The object for which to enumerate properties
name String Optional name for the logged object
Table 2. Returns
Type Description
void

var arr = ["a","b","c"];
 
var inc = new GlideRecord("incident");
//get an active incident
inc.addActiveQuery();
inc.setLimit(1);
inc.query();
inc.next();
 
JSUtil.logObject(arr, "arr");
JSUtil.logObject(inc, "inc");
Output:
Log Object: arr
  Array of 3 elements
    [0]: string = a
    [1]: string = b
    [2]: string = c
Log Object: inc
  GlideRecord('incident') @ INC0000002