3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 00:00:28 +01:00

LoggerWrapper changes, @Getter

Dieser Commit ist enthalten in:
creeper123123321 2018-06-22 14:37:29 -03:00
Ursprung f12a210665
Commit ffa696b963
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 0AC57D54786721D1
2 geänderte Dateien mit 22 neuen und 86 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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