lore
Version:
Convention-driven framework for building React-Redux applications
25 lines (22 loc) • 804 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getLogger;
/**
* Build a logger that works in both the browser and in Node (to support testing)
* TODO: Replace this with a more capable logger that supports colors and logging levels
*
* @returns {Function} The logger to be used
*/
function getLogger() {
var logger = console.log.bind(console);
// Add additional logging methods and bind them to console. If you don't, they
// will throw "Illegal Invocation" errors.
var additionalLoggingMethods = ['error', 'debug', 'verbose', 'silly', 'info'];
additionalLoggingMethods.forEach(function (logMethod) {
logger[logMethod] = (console[logMethod] || console.log).bind(console);
});
return logger;
}
module.exports = exports['default'];