refactor: use window.newrelic directly

This commit is contained in:
Shivam Mishra
2025-03-13 11:57:48 +05:30
parent a35b3a343e
commit ef37e83aad
3 changed files with 18 additions and 16 deletions
@@ -82,9 +82,12 @@ class BaseActionCableConnector {
onReceived = ({ event, data } = {}) => {
if (this.isAValidEvent(data)) {
if (this.events[event] && typeof this.events[event] === 'function') {
window.logrelic(
`processing actioncable ${event} with ${JSON.stringify(data, null, 2)} at ${Number(Date.now())}`
);
if (window.newrelic) {
window.newrelic.log(
`processing actioncable ${event} with ${JSON.stringify(data, null, 2)} at ${Number(Date.now())}`,
{ level: 'DEBUG' }
);
}
this.events[event](data);
}
}