import { onEvent, onError, onConsoleOutput } from '../track'; import { util } from '../util'; const types: string[] = ["log", "error", "info", "warn"]; export default function () { util.each(types, false, (type: string) => { let oldFnType = window.console[type]; window.console[type] = function () { let now = new Date(), trigger = "Console", fullUrl = window.location.href + window.location.hash; onConsoleOutput({ type: util.capitalizeFirstLetter(type), data: Array.prototype.slice.call(arguments).join(' '), occurredAt: new Date() }); oldFnType.apply(this, arguments); }; }); }