UNPKG

browser-logging-transport

Version:
45 lines (28 loc) 860 B
!function (root, factory) { if ('function' === typeof define && define.amd) { define('BLT', [], function () { return (root.mymodule = factory()) }); } else if ('object' === typeof module && module.exports) { module.exports = factory(); } else { root['BLT'] = factory(); } }(this, function () { 'use strict'; return function (boundTransportFn) { Object.keys(console).forEach(function (key) { let f; if ((f = console[key]) && typeof f === 'function') { console[key] = function () { Object.values(arguments).forEach(function (a) { boundTransportFn(a); }); f.apply(console, arguments); } } }); } });