Skip to content

Commit

Permalink
feat(colors): expose color-free logging option (#653)
Browse files Browse the repository at this point in the history
closes #457
  • Loading branch information
vikaspotluri123 authored and acburdine committed Mar 26, 2018
1 parent f073dc5 commit ba58fab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ const bootstrap = {
type: 'boolean',
default: true
})
.option('color', {
describe: '[--no-color] Allow/Disallow colorful logging',
type: 'boolean',
default: true
})
.version(false)
.parse(argv);
}
Expand Down
3 changes: 1 addition & 2 deletions lib/ui/pretty-stream.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';

const moment = require('moment');
const Transform = require('stream').Transform;
const format = require('util').format;
Expand Down Expand Up @@ -134,7 +133,7 @@ class PrettyStream extends Transform {
}

if (value.code) {
error += `${levelColor(`CODE: ${value.code}`)}\n`
error += `${levelColor(`CODE: ${value.code}`)}\n`;
}

error += `${levelColor(`MESSAGE: ${value.message}`)}\n\n`;
Expand Down

0 comments on commit ba58fab

Please sign in to comment.