Debug a SuiteScript 2.0 SSP Application

The creation of an SSP Application record enables you to write debugging details to the script execution log when SSP application scripts are run. These details are displayed on the Execution Log subtab of the SSP Application record.

There are two ways to debug SSP applications written in SuiteScript 2.0:

Debug using the N/log Module

            <%@NApiVersion="2.x"%>
<%@ require path="N/log" alias="testLog"%>
<%
    var x = 'value';
    testLog.audit({
        title: 'audit log',
        details: 'value of x is: '+x
    });
    testLog.debug({
        title: 'debug log',
        details: 'value of x is: '+x
    });
    testLog.emergency({
        title: 'emergency log',
        details: 'value of x is: '+x
    });
    testLog.error({
        title: 'error log',
        details: 'value of x is: '+x
    });
%> 

          

Debug without Loading the N/log Module

            <%@NApiVersion="2.x"%>
<%
    var x = 'value';
    log.audit({
        title: 'audit log',
        details: 'value of x is: '+x
    });
    log.debug({
        title: 'debug log',
        details: 'value of x is: '+x
    });
    log.emergency({
        title: 'emergency log',
        details: 'value of x is: '+x
    });
    log.error({
        title: 'error log',
        details: 'value of x is: '+x
    });
%> 

          

Related Topics

General Notices