Merge pull request #1992 from twain47/loggerhelper-readability
Clean up log output from determine-basal.js
This commit is contained in:
commit
9d55ef9120
|
@ -1,12 +1,33 @@
|
|||
var console = { };
|
||||
console.error = function error(){
|
||||
var s = '';
|
||||
for (var i = 0, len = arguments.length; i < len; i++) {
|
||||
console2.log(arguments[i]);
|
||||
if (i > 0) s = s + ' ';
|
||||
if (typeof arguments[i] === 'undefined') {
|
||||
s = s + 'undefined';
|
||||
} else if (typeof arguments[i] === 'object') {
|
||||
s = s + JSON.stringify(arguments[i]);
|
||||
} else {
|
||||
s = s + arguments[i].toString();
|
||||
}
|
||||
}
|
||||
s = s + "\n";
|
||||
console2.log(s);
|
||||
};
|
||||
|
||||
console.log = function log(){
|
||||
var s = '';
|
||||
for (var i = 0, len = arguments.length; i < len; i++) {
|
||||
console2.log(arguments[i]);
|
||||
if (i > 0) s = s + ' ';
|
||||
if (typeof arguments[i] === 'undefined') {
|
||||
s = s + 'undefined';
|
||||
} else if (typeof arguments[i] === 'object') {
|
||||
s = s + JSON.stringify(arguments[i]);
|
||||
} else {
|
||||
s = s + arguments[i].toString();
|
||||
}
|
||||
//console2.log(arguments[i]);
|
||||
}
|
||||
s = s + "\n";
|
||||
console2.log(s);
|
||||
};
|
||||
|
|
|
@ -36,16 +36,14 @@ public class LoggerCallback extends ScriptableObject {
|
|||
|
||||
public void jsFunction_log(Object obj1) {
|
||||
if (L.isEnabled(L.APS))
|
||||
log.debug(obj1.toString());
|
||||
log.debug(obj1.toString().trim());
|
||||
logBuffer.append(obj1.toString());
|
||||
logBuffer.append(' ');
|
||||
}
|
||||
|
||||
public void jsFunction_error(Object obj1) {
|
||||
if (L.isEnabled(L.APS))
|
||||
log.error(obj1.toString());
|
||||
log.error(obj1.toString().trim());
|
||||
errorBuffer.append(obj1.toString());
|
||||
errorBuffer.append(' ');
|
||||
}
|
||||
|
||||
|
||||
|
@ -60,4 +58,4 @@ public class LoggerCallback extends ScriptableObject {
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue