@wdio/logger
Advanced tools
Comparing version 5.6.4 to 5.7.0
@@ -30,2 +30,7 @@ "use strict"; | ||
}; | ||
const matches = { | ||
COMMAND: 'COMMAND', | ||
DATA: 'DATA', | ||
RESULT: 'RESULT' | ||
}; | ||
const SERIALIZERS = [{ | ||
@@ -41,3 +46,3 @@ /** | ||
*/ | ||
matches: log => log === 'COMMAND', | ||
matches: log => log === matches.COMMAND, | ||
serialize: log => _chalk.default.magenta(log) | ||
@@ -48,3 +53,3 @@ }, { | ||
*/ | ||
matches: log => log === 'DATA', | ||
matches: log => log === matches.DATA, | ||
serialize: log => _chalk.default.yellow(log) | ||
@@ -55,3 +60,3 @@ }, { | ||
*/ | ||
matches: log => log === 'RESULT', | ||
matches: log => log === matches.RESULT, | ||
serialize: log => _chalk.default.cyan(log) | ||
@@ -74,3 +79,15 @@ }]; | ||
} | ||
/** | ||
* split `prefixer: value` sting to `prefixer: ` and `value` | ||
* so that SERIALIZERS can match certain string | ||
*/ | ||
const match = Object.values(matches).filter(x => args[0].endsWith(`: ${x}`))[0]; | ||
if (match) { | ||
const prefixStr = args.shift().slice(0, -match.length - 1); | ||
args.unshift(prefixStr, match); | ||
} | ||
args = args.map(arg => { | ||
@@ -77,0 +94,0 @@ for (const s of SERIALIZERS) { |
{ | ||
"name": "@wdio/logger", | ||
"version": "5.6.4", | ||
"version": "5.7.0", | ||
"description": "A helper utility for logging of WebdriverIO packages", | ||
@@ -41,3 +41,3 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
}, | ||
"gitHead": "09f998f9e785873378b4436fd39c4dc37aa6e248" | ||
"gitHead": "11da9ad430f42d8d03ace1d9f7b83ac29a8ce7f8" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7600
168