Created
January 16, 2019 07:34
-
-
Save Pum-purum/e748af8e88682f392a001671ecfc7535 to your computer and use it in GitHub Desktop.
Bitrix JS logging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var originalBxOnCustomEvent = BX.onCustomEvent; | |
BX.onCustomEvent = function (eventObject, eventName, eventParams, secureParams) { | |
var logData = { | |
eventObject: eventObject, | |
eventName: eventName, | |
eventParams: eventParams, | |
secureParams: secureParams | |
}; | |
if (eventObject !== null && typeof eventObject == 'object' && eventObject.constructor) { | |
logData['eventObjectClassName'] = eventObject.constructor.name; | |
} | |
console.log(logData); | |
originalBxOnCustomEvent.apply(null, [eventObject, eventName, eventParams, secureParams]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment