Exam4Training

What are three advantages of using ccLog over the Salesforce standard System.debug class? (3 answers)

What are three advantages of using ccLog over the Salesforce standard System.debug class? (3 answers)
A . There is no need to use string concatenation to easily tag log statements with a subject.
B . ccLog can debug syntax errors found in the JavaScript.
C . There is no need to create a User Trace Flag.
D . Append #ccLog=<Logging Token Name> to the end of the storefront URL in order to get logs in the inspector console.
E . There is no need to manually set a cookie to debug with the Site Guest User.

Answer: A,D,E

Explanation:

Three advantages of using ccLog over the Salesforce standard System.debug class are:

There is no need to use string concatenation to easily tag log statements with a subject. ccLog allows passing a subject parameter to the log method, which will prepend the subject to the log message. For example, ccLog.log(‘This is a message’, ‘Subject’) will log [Subject] This is a message.

There is no need to create a User Trace Flag. ccLog can be enabled by setting the value of CO.logToken to true in CCAdmin, which will activate logging for all users who access the storefront. There is no need to manually set a cookie to debug with the Site Guest User. ccLog can be enabled for the Site Guest User by appending #ccLog=<Logging Token Name> to the end of the storefront URL in order to get logs in the inspector console. For example, https://my-storefront.com/#ccLog=debug will enable logging for the Site Guest User with the debug level.

Reference: B2B Commerce and D2C Commerce Developer Guide, Logging

Exit mobile version