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 asubject. 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= 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. Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Logging
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit