Improve logging
This commit is contained in:
@@ -4,10 +4,10 @@ console.log('Load lib module');
|
|||||||
|
|
||||||
function compare(a, b, operator) {
|
function compare(a, b, operator) {
|
||||||
// Hint: a = currentState, b = targetState
|
// Hint: a = currentState, b = targetState
|
||||||
let logMsg = a + ', ' + b + ' with operator ' + operator;
|
let logMsg = '';
|
||||||
let returnValue = undefined;
|
let returnValue = undefined;
|
||||||
try {
|
try {
|
||||||
logMsg = 'Quantity comparison of ' + logMsg;
|
logMsg = 'Quantity comparison of ' + a + ', ' + b + ' with operator ' + operator;
|
||||||
switch (operator) {
|
switch (operator) {
|
||||||
case '==':
|
case '==':
|
||||||
returnValue = a.equal(b);
|
returnValue = a.equal(b);
|
||||||
@@ -29,7 +29,7 @@ function compare(a, b, operator) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
logMsg = 'Standard comparison of ' + logMsg;
|
logMsg = 'Standard comparison of ' + a + ', ' + b + ' with operator ' + operator;
|
||||||
switch (operator) {
|
switch (operator) {
|
||||||
case '==':
|
case '==':
|
||||||
returnValue = (a == b);
|
returnValue = (a == b);
|
||||||
|
|||||||
Reference in New Issue
Block a user