Skip to content

Commit 26b7400

Browse files
committed
Fixed formatColor for node.js.
1 parent f2de950 commit 26b7400

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/node/formatters/color.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var Transform = require('../../common/transform.js'),
2-
style = require('./util.js').style;
2+
style = require('./util.js').style,
3+
util = require('util');
34

45
function FormatColor() {}
56

@@ -10,7 +11,9 @@ FormatColor.prototype.write = function(name, level, args) {
1011
function pad(s) { return (s.toString().length == 4? ' '+s : s); }
1112
this.emit('item', (name ? name + ' ' : '')
1213
+ (level ? style('- ' + pad(level.toUpperCase()) + ' -', colors[level]) + ' ' : '')
13-
+ args.join(' '));
14+
+ args.map(function(item) {
15+
return (typeof item == 'string' ? item : util.inspect(item, null, 3, true));
16+
}).join(' '));
1417
};
1518

1619
module.exports = FormatColor;

0 commit comments

Comments
 (0)