logger reformat

This commit is contained in:
AdrianLxM 2017-10-15 22:34:03 +02:00
parent c499e5977c
commit 3e7b7ced06

View file

@ -38,23 +38,24 @@ public class LoggerCallback extends ScriptableObject {
public void jsFunction_log(Object obj1) { public void jsFunction_log(Object obj1) {
log.debug(obj1.toString()); log.debug(obj1.toString());
logBuffer.append(obj1.toString()); logBuffer.append(obj1.toString());
logBuffer.append('\n'); logBuffer.append(' ');
} }
public void jsFunction_error(Object obj1) { public void jsFunction_error(Object obj1) {
log.error(obj1.toString()); log.error(obj1.toString());
errorBuffer.append(obj1.toString()); errorBuffer.append(obj1.toString());
errorBuffer.append('\n'); errorBuffer.append(' ');
} }
public static String getScriptDebug(){ public static String getScriptDebug(){
String ret = ""; String ret = "";
if(errorBuffer.length() >= 0){ if(errorBuffer.length() > 0){
ret += "e:\n" + errorBuffer.toString(); ret += "e:\n" + errorBuffer.toString();
} }
if(logBuffer.length() >= 0){ if(ret.length() > 0 && logBuffer.length() > 0) ret += '\n';
if(logBuffer.length() > 0){
ret += "d:\n" + logBuffer.toString(); ret += "d:\n" + logBuffer.toString();
} }
return ret; return ret;