Browse Source

[logger] Added logger

0.7.0-breaking-rewrite
Muthu Kumar 6 years ago
parent
commit
08ac27e80a
  1. 14
      src/lib/logger.js

14
src/lib/logger.js

@ -0,0 +1,14 @@
/**
* Creates a Logger that only logs if 'log' option was true
* @param {Object} options
* @param {boolean=} options.log
*/
const logger = options => {
const log = (...strings) => options.log && console.log(...strings);
log.true = options.log;
return log;
};
module.exports = {
create: logger,
};
Loading…
Cancel
Save