1
0

Improve logging

This commit is contained in:
2023-08-14 19:49:28 +02:00
parent 5df01b6ebb
commit d4c6d12fa3

View File

@@ -4,10 +4,10 @@ console.log('Load lib module');
function compare(a, b, operator) {
// Hint: a = currentState, b = targetState
let logMsg = a + ', ' + b + ' with operator ' + operator;
let logMsg = '';
let returnValue = undefined;
try {
logMsg = 'Quantity comparison of ' + logMsg;
logMsg = 'Quantity comparison of ' + a + ', ' + b + ' with operator ' + operator;
switch (operator) {
case '==':
returnValue = a.equal(b);
@@ -29,7 +29,7 @@ function compare(a, b, operator) {
break;
}
} catch(e) {
logMsg = 'Standard comparison of ' + logMsg;
logMsg = 'Standard comparison of ' + a + ', ' + b + ' with operator ' + operator;
switch (operator) {
case '==':
returnValue = (a == b);