EaglerForge/sources/main/java/net/eaglerforge/api/LoggerAPI.java

37 lines
1.2 KiB
Java
Raw Normal View History

2024-02-16 10:43:17 -06:00
package net.eaglerforge.api;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
public class LoggerAPI {
public static final Logger log = LogManager.getLogger();
public static ModData makeModData() {
ModData loggerGlobal = new ModData();
loggerGlobal.setCallbackVoidWithDataArg("loginfo", (BaseData params) -> {
log.info(params.getString("string"));
});
loggerGlobal.setCallbackVoidWithDataArg("logdebug", (BaseData params) -> {
log.debug(params.getString("string"));
});
loggerGlobal.setCallbackVoidWithDataArg("logerror", (BaseData params) -> {
log.error(params.getString("string"));
});
loggerGlobal.setCallbackVoidWithDataArg("logwarn", (BaseData params) -> {
log.warn(params.getString("string"));
});
loggerGlobal.setCallbackVoidWithDataArg("logfatal", (BaseData params) -> {
log.fatal(params.getString("string"));
});
loggerGlobal.setCallbackVoidWithDataArg("logtrace", (BaseData params) -> {
log.trace(params.getString("string"));
});
return loggerGlobal;
}
}