diff --git a/package.json b/package.json index 536380c..cf8ae4d 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ }, "options": { "default": { - "coloredInterpolation": false, "displayScope": true, "displayBadge": true, "displayDate": false, diff --git a/readme.md b/readme.md index 7eada62..5e24b58 100644 --- a/readme.md +++ b/readme.md @@ -362,7 +362,6 @@ The following illustrates all the available options with their respective defaul ```json { "signale": { - "coloredInterpolation": false, "displayScope": true, "displayBadge": true, "displayDate": false, @@ -381,13 +380,6 @@ The following illustrates all the available options with their respective defaul
View all of the available options in detail. -##### `coloredInterpolation` - -- Type: `Boolean` -- Default: `false` - -Display the arguments, which replace the placeholder tokens on string interpolation, colored. - ##### `displayScope` - Type: `Boolean` diff --git a/signale.js b/signale.js index 563820d..f163045 100644 --- a/signale.js +++ b/signale.js @@ -133,22 +133,8 @@ class Signale { return `[${this.timestamp}]`; } - _formatMessage(str, type) { - str = this._arrayify(str); - - if (this._config.coloredInterpolation) { - const _ = Object.assign({}, util.inspect.styles); - - Object.keys(util.inspect.styles).forEach(x => { - util.inspect.styles[x] = type.color || _[x]; - }); - - str = util.formatWithOptions({colors: true}, ...str); - util.inspect.styles = Object.assign({}, _); - return str; - } - - return util.format(...str); + _formatMessage(str) { + return util.format(...this._arrayify(str)); } _meta() { @@ -178,8 +164,8 @@ class Signale { return meta; } - _hasAdditional({suffix, prefix}, args, type) { - return (suffix || prefix) ? '' : this._formatMessage(args, type); + _hasAdditional({suffix, prefix}, args) { + return (suffix || prefix) ? '' : this._formatMessage(args); } _buildSignale(type, ...args) { @@ -191,10 +177,10 @@ class Signale { } else { const [{prefix, message, suffix}] = args; additional = Object.assign({}, {suffix, prefix}); - msg = message ? this._formatMessage(message, type) : this._hasAdditional(additional, args, type); + msg = message ? this._formatMessage(message) : this._hasAdditional(additional, args); } } else { - msg = this._formatMessage(args, type); + msg = this._formatMessage(args); } const signale = this._meta();