Improve logging
This commit is contained in:
10
utils/lib.js
10
utils/lib.js
@@ -27,6 +27,9 @@ function compare(a, b, operator) {
|
||||
case '>=':
|
||||
returnValue = a.greaterThanOrEqual(b);
|
||||
break;
|
||||
default:
|
||||
console.error(`${operator} is no valid operator`);
|
||||
return;
|
||||
}
|
||||
} catch(e) {
|
||||
logMsg = `Standard comparison of ${a}, ${b} with operator ${operator}`;
|
||||
@@ -52,12 +55,7 @@ function compare(a, b, operator) {
|
||||
}
|
||||
}
|
||||
|
||||
if (returnValue == undefined) {
|
||||
console.error(`${operator} is no valid operator`);
|
||||
} else {
|
||||
console.debug(logMsg);
|
||||
}
|
||||
|
||||
console.debug(logMsg);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user