function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rowan  ChristmasRowan Christmas 

LockerService and $A.logger

Apologies for the cross-post, I'm not sure where the devs are hanging out, and I'm not sure where I'm supposed to file LockerService cases... 

Here is my stack exchange question:
http://salesforce.stackexchange.com/questions/129894/lockerservice-not-allowing-subscribing-to-a-logger

I've been using the technique described here:
https://developer.salesforce.com/forums/?id=906F0000000B1MiIAK

But now this is throwing an error.

Thanks!
NagendraNagendra (Salesforce Developers) 
Hi Rowan,

As this post is already addressed in the stack exchange community as below:

With locker being activated you will not be able to use the undocumented API's and this was one of the reason why locker is in place.

See the JavaScript API to find available methods and objects at https://mydomain.lightning.force.com/auradocs/reference.app, where myDomain is the name of your custom Salesforce domain.

The correct way to log the errors has been documented in release guide
<!--c:recoverableError-->
<aura:component>
<p>Click the button to trigger the controller to throw an error.</p>
<div aura:id="div1"></div>

<ui:button label="Throw an Error" press="{!c.throwErrorForKicks}"/>
The JS controller side function is as below
/*recoverableErrorController.js*/
 ({
    throwErrorForKicks: function(cmp) {
    // this sample always throws an error to demo try/catch
    var hasPerm = false;
    try {
        if (!hasPerm) {
            throw new Error("You don't have permission to edit this record.");
        }
    }
    catch (e) {
        $A.createComponents([
            ["ui:message",{
                "title" : "Sample Thrown Error",
                "severity" : "error",
            }],
            ["ui:outputText",{
                "value" : e.message
            }]
            ],
            function(components, status){
                if (status === "SUCCESS") {
                    var message = components[0];
                    var outputText = components[1];
                    // set the body of the ui:message to be the ui:outputText
                    message.set("v.body", outputText);
                    var div1 = cmp.find("div1");
                    // Replace div body with the dynamic component
                    div1.set("v.body", message);
                }
            }
        );
    }
  }
})
Kindly mark this post as solved if it's resolved so that it gets removed from the unanswered queue and becomes a proper solution which results in helping others who are really in need of it.

Best Regards,
Nagendra.P