Disable logging in LA

In the Agent SDK, the assist-aed.js source contains a logging wrapper used to log messages at various levels into the browser's JS console - as opposed to logging information directly with console.log().  This enables a certain level of control over which types of logs we wish to publish.

The assistLogger object:

/ Mock assistLogger in case we're using AED directly:
if (!window.assistLogger) {
    window.assistLogger = {
        warn: console.warn.bind(console),
        error: console.error.bind(console),
        log: console.log.bind(console),
        info: console.info.bind(console)
    };
}


Override the default assistLogger properties:

As shown, the different levels are: log, info, warn and error.  You can override any of these so that nothing is returned for that specific level of console logs - others will still show unless you also override these to return nothing.  So effectively, you are able to control which ones are shown to the user should they view the browser's developer tools.

The following code snippet is an example of how you would disable info-level logs in the SDK:

assistLogger.info = function() {
    return false;
}


You can test it by typing this directly into the browser JS console when the Agent SDK is loaded - or - you can run it somewhere in your Agent Console application.

This should also work in the CafeX reference samples and affect both the Agent and Consumer SDKs (but needs to be executed on the Agent side).

Below is an example within Google Chrome's Developer Tools:
Screen_Shot_2017-05-24_at_07.22.26.png

Disable Consumer SDK logging:

An alternative way to disable logging (Consumer side only) is to add disableLogging: true as one of your startSupport properties.  Example below:

AssistSDK.startSupport({
    destination: "agent1",
    disableLogging: true
});


This appears to be working as of Live Assist 1.45.

Have more questions? Submit a request

Comments

Powered by Zendesk