-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Avoid having to use chalk all the time
- Loading branch information
Julien Lengrand-Lambert
authored and
Julien Lengrand-Lambert
committed
Apr 30, 2018
1 parent
1ac4ac3
commit aef29ed
Showing
4 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
const chalk = require('chalk'); | ||
|
||
var Logger = function(){}; | ||
|
||
Logger.prototype.log = function(...args) { | ||
console.log(...args); | ||
} | ||
|
||
Logger.prototype.warn = function(...args) { | ||
console.log(chalk.yellow.bold(...args)); | ||
} | ||
|
||
Logger.prototype.err = function(...args) { | ||
console.log(chalk.red.bold(...args)); | ||
} | ||
|
||
module.exports = { | ||
logger: console | ||
}; | ||
logger: new Logger() | ||
} |