Skip to content

Commit

Permalink
Use object literal instead of constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Lengrand-Lambert authored and Julien Lengrand-Lambert committed May 1, 2018
1 parent e45afa6 commit 28a1440
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions lib/utils/logger/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const chalk = require('chalk');

var Logger = function(){};
const Logger = {
log : (...args) =>{
console.log(...args);
},

warn : (...args) =>{
console.log('⚠️', chalk.yellow.bold(...args));
},

err : (...args) =>{
console.log('🙀', chalk.red.bold(...args));
}

Logger.prototype.log = function(...args) {
console.log(...args);
}

Logger.prototype.warn = function(...args) {
console.log('\n⚠️', chalk.yellow.bold(...args));
}

Logger.prototype.err = function(...args) {
console.log('\n🙀', chalk.red.bold(...args));
}
};

module.exports = {
logger: new Logger()
logger: Logger
}

0 comments on commit 28a1440

Please sign in to comment.