log-segment
Advanced tools
Comparing version 1.0.6 to 1.0.7
35
main.js
@@ -165,22 +165,21 @@ 'use strict' | ||
} | ||
let _args = Array.prototype.slice.call(arguments) | ||
_args = _args.map((message) => { | ||
// stringify an object | ||
if (typeof message === 'object') { | ||
message = JSON.stringify(message) | ||
} else if (typeof message === 'function') { | ||
message = message() | ||
} | ||
// add segment color | ||
// paint the message | ||
if (__segments[segment] && | ||
__segments[segment].color && | ||
chalk[__segments[segment].color]) { | ||
return chalk[__segments[segment].color](message) | ||
} | ||
return message | ||
}) | ||
// add segment color | ||
if (__segments[segment] && __segments[segment].color) { | ||
_args = _args.map((message) => { | ||
// stringify an object | ||
if (typeof message === 'object') { | ||
message = JSON.stringify(message) | ||
} else if (typeof message === 'function') { | ||
message = message() | ||
} | ||
// paint the message | ||
if (chalk[__segments[segment].color]) { | ||
return chalk[__segments[segment].color](message) | ||
} else { | ||
return message | ||
} | ||
}) | ||
} | ||
// add marker | ||
@@ -187,0 +186,0 @@ if (__levels[level].marker) { |
{ | ||
"name": "log-segment", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "logger with partition", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
9041
195