mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 00:04:10 -08:00
parent
2e0864017b
commit
47c136ccc1
|
@ -23,6 +23,7 @@ import org.teavm.classlib.java.lang.TThrowable;
|
||||||
import org.teavm.classlib.java.util.THashMap;
|
import org.teavm.classlib.java.util.THashMap;
|
||||||
import org.teavm.classlib.java.util.TMap;
|
import org.teavm.classlib.java.util.TMap;
|
||||||
import org.teavm.jso.JSBody;
|
import org.teavm.jso.JSBody;
|
||||||
|
import org.teavm.jso.impl.JS;
|
||||||
|
|
||||||
public class TLogger {
|
public class TLogger {
|
||||||
public static final String GLOBAL_LOGGER_NAME = "global";
|
public static final String GLOBAL_LOGGER_NAME = "global";
|
||||||
|
@ -70,14 +71,26 @@ public class TLogger {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (record.getLevel().intValue() >= TLevel.SEVERE.intValue()) {
|
if (record.getLevel().intValue() >= TLevel.SEVERE.intValue()) {
|
||||||
|
if (PlatformDetector.isWebAssemblyGC()) {
|
||||||
|
JS.invoke(JS.global("console"), JS.wrap("error"), JS.wrap(message));
|
||||||
|
} else {
|
||||||
error(message);
|
error(message);
|
||||||
|
}
|
||||||
} else if (record.getLevel().intValue() >= TLevel.WARNING.intValue()) {
|
} else if (record.getLevel().intValue() >= TLevel.WARNING.intValue()) {
|
||||||
|
if (PlatformDetector.isWebAssemblyGC()) {
|
||||||
|
JS.invoke(JS.global("console"), JS.wrap("warn"), JS.wrap(message));
|
||||||
|
} else {
|
||||||
warn(message);
|
warn(message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (PlatformDetector.isWebAssemblyGC()) {
|
||||||
|
JS.invoke(JS.global("console"), JS.wrap("info"), JS.wrap(message));
|
||||||
} else {
|
} else {
|
||||||
infoImpl(message);
|
infoImpl(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private String format(String message, Object[] params) {
|
private String format(String message, Object[] params) {
|
||||||
if (params == null) {
|
if (params == null) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user