UNPKG

@honeybadger-io/core

Version:
38 lines 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var util_1 = require("../util"); function default_1(_window) { if (_window === void 0) { _window = (0, util_1.globalThisOrWindow)(); } return { shouldReloadOnConfigure: false, load: function (client) { function sendEventsToInsights() { return client.config.eventsEnabled; } if (!sendEventsToInsights()) { return; } (0, util_1.instrumentConsole)(_window, function (level, args) { if (!sendEventsToInsights()) { return; } if (args.length === 0) { return; } var data = { severity: level, }; if (typeof args[0] === 'string') { data.message = args[0]; data.args = args.slice(1); } else { data.args = args; } client.event('log', data); }); } }; } exports.default = default_1; //# sourceMappingURL=events.js.map