Fix formatting of default capabilities
MODIFY
lib/main.js
lib/main.js
@@ -48,9 +48,32 @@ function logDeprecationWarning (deprecatedArgs) {
}
function logNonDefaultArgsWarning (args) {
+ // cleanly print out the default arguments, allowing for prefix and timestamp
+ function getValueArray (obj, indent = ' ') {
+ if (!_.isObject(obj)) {
+ return [obj];
+ }
+
+ let strArr = ['{'];
+ for (let [arg, value] of _.toPairs(obj)) {
+ if (!_.isObject(value)) {
+ strArr.push(`${indent} ${arg}: ${value}`);
+ } else {
+ value = getValueArray(value, `${indent} `);
+ strArr.push(`${indent} ${arg}: ${value.shift()}`);
+ strArr.push(...value);
+ }
+ }
+ strArr.push(`${indent}}`);
+ return strArr;
+ }
logger.info('Non-default server args:');
for (let [arg, value] of _.toPairs(args)) {
- logger.info(` ${arg}: ${util.inspect(value)}`);
+ value = getValueArray(value);
+ logger.info(` ${arg}: ${value.shift()}`);
+ for (let val of value) {
+ logger.info(val);
+ }
}
}

Fix formatting of default capabilities