LoggerWrapper changes, @Getter

This commit is contained in:
creeper123123321 2018-06-22 14:37:29 -03:00
parent f12a210665
commit ffa696b963
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1
2 changed files with 22 additions and 86 deletions

View File

@ -55,7 +55,9 @@ public class SpongePlugin implements ViaPlatform {
@DefaultConfig(sharedRoot = false)
private File defaultConfig;
@Getter
private SpongeViaAPI api = new SpongeViaAPI();
@Getter
private SpongeConfigAPI conf;
@Getter
@ -191,16 +193,6 @@ public class SpongePlugin implements ViaPlatform {
return true;
}
@Override
public ViaAPI getApi() {
return api;
}
@Override
public SpongeConfigAPI getConf() {
return conf;
}
@Override
public ConfigurationProvider getConfigurationProvider() {
return conf;

View File

@ -2,6 +2,7 @@ package us.myles.ViaVersion.sponge.util;
import org.slf4j.Logger;
import java.text.MessageFormat;
import java.util.logging.Level;
import java.util.logging.LogRecord;
@ -20,106 +21,49 @@ public class LoggerWrapper extends java.util.logging.Logger {
@Override
public void log(Level level, String msg) {
if (level == Level.FINEST) {
base.trace(msg);
return;
}
if (level == Level.FINE) {
if (level == Level.FINE)
base.debug(msg);
return;
}
if (level == Level.WARNING) {
else if (level == Level.WARNING)
base.warn(msg);
return;
}
if (level == Level.SEVERE) {
else if (level == Level.SEVERE)
base.error(msg);
return;
}
if (level == Level.INFO) {
else if (level == Level.INFO)
base.info(msg);
return;
}
base.trace(msg);
return;
else
base.trace(msg);
}
@Override
public void log(Level level, String msg, Object param1) {
if (level == Level.FINEST) {
base.trace(msg, param1);
return;
}
if (level == Level.FINE) {
if (level == Level.FINE)
base.debug(msg, param1);
return;
}
if (level == Level.WARNING) {
else if (level == Level.WARNING)
base.warn(msg, param1);
return;
}
if (level == Level.SEVERE) {
else if (level == Level.SEVERE)
base.error(msg, param1);
return;
}
if (level == Level.INFO) {
else if (level == Level.INFO)
base.info(msg, param1);
return;
}
base.trace(msg, param1);
return;
else
base.trace(msg, param1);
}
@Override
public void log(Level level, String msg, Object[] params) {
if (level == Level.FINEST) {
base.trace(msg, params);
return;
}
if (level == Level.FINE) {
base.debug(msg, params);
return;
}
if (level == Level.WARNING) {
base.warn(msg, params);
return;
}
if (level == Level.SEVERE) {
base.error(msg, params);
return;
}
if (level == Level.INFO) {
base.info(msg, params);
return;
}
base.trace(msg, params);
return;
log(level, MessageFormat.format(msg, params)); // workaround not formatting correctly
}
@Override
public void log(Level level, String msg, Throwable params) {
if (level == Level.FINEST) {
base.trace(msg, params);
return;
}
if (level == Level.FINE) {
if (level == Level.FINE)
base.debug(msg, params);
return;
}
if (level == Level.WARNING) {
else if (level == Level.WARNING)
base.warn(msg, params);
return;
}
if (level == Level.SEVERE) {
else if (level == Level.SEVERE)
base.error(msg, params);
return;
}
if (level == Level.INFO) {
else if (level == Level.INFO)
base.info(msg, params);
return;
}
base.trace(msg, params);
return;
else
base.trace(msg, params);
}
}