b24-snippets/bx-custom-include/event-log/script.js

24 lines
640 B
JavaScript
Raw Permalink Normal View History

2024-09-18 19:16:43 -04:00
let originalBxOnCustomEvent = BX.onCustomEvent;
BX.onCustomEvent = function (eventObject, eventName, eventParams, secureParams) {
let realEventName = BX.type.isString(eventName) ?
eventName : BX.type.isString(eventObject) ? eventObject : null;
if (realEventName) {
console.log(
'%c' + realEventName,
'background: #222; color: #bada55; font-weight: bold; padding: 3px 4px;'
);
}
console.dir({
eventObject: eventObject,
eventParams: eventParams,
secureParams: secureParams
});
originalBxOnCustomEvent.apply(
null, arguments
);
};