paint warning and error log messages

This commit is contained in:
igor 2016-08-18 23:53:40 +03:00
parent 52c88e5f43
commit 7308d7be94
2 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,6 @@
import Progress from 'progress';
import assert from 'assert';
import chalk from 'chalk';
class Log {
info (text) {
@ -7,11 +8,12 @@ class Log {
}
warn (text) {
console.log('> ' + text); // TODO warn?
console.log(`> ${chalk.blue('WARN')} ${text}`);
}
error (text) {
console.log('> ' + text); // TODO error?
if (text.message) text = text.message;
console.log(`> ${chalk.red('ERR!')} ${text}`);
}
enableProgress (text) {

View File

@ -17,10 +17,11 @@
"dependencies": {
"babel-runtime": "6.11.6",
"byline": "5.0.0",
"chalk": "^1.1.3",
"expand-template": "1.0.2",
"fs-promise": "0.5.0",
"progress": "1.1.8",
"minimist": "1.2.0",
"progress": "1.1.8",
"request": "2.74.0",
"request-progress": "2.0.1",
"semver": "5.3.0",