Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-20 06:50:08 +01:00
Use correct logger for configuration warnings (#3685)
Fixes https://github.com/ViaVersion/ViaProxy/issues/179
Dieser Commit ist enthalten in:
Ursprung
87d444a017
Commit
ad62d8552c
@ -180,12 +180,12 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
|
|||||||
|
|
||||||
if (c == '<') {
|
if (c == '<') {
|
||||||
if (lowerBound != -1) {
|
if (lowerBound != -1) {
|
||||||
Via.getPlatform().getLogger().warning("Already set lower bound " + lowerBound + " overridden by " + protocolVersion.getName());
|
LOGGER.warning("Already set lower bound " + lowerBound + " overridden by " + protocolVersion.getName());
|
||||||
}
|
}
|
||||||
lowerBound = protocolVersion.getVersion();
|
lowerBound = protocolVersion.getVersion();
|
||||||
} else {
|
} else {
|
||||||
if (upperBound != -1) {
|
if (upperBound != -1) {
|
||||||
Via.getPlatform().getLogger().warning("Already set upper bound " + upperBound + " overridden by " + protocolVersion.getName());
|
LOGGER.warning("Already set upper bound " + upperBound + " overridden by " + protocolVersion.getName());
|
||||||
}
|
}
|
||||||
upperBound = protocolVersion.getVersion();
|
upperBound = protocolVersion.getVersion();
|
||||||
}
|
}
|
||||||
@ -199,7 +199,7 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
|
|||||||
|
|
||||||
// Add single protocol version and check for duplication
|
// Add single protocol version and check for duplication
|
||||||
if (!blockedProtocols.add(protocolVersion.getVersion())) {
|
if (!blockedProtocols.add(protocolVersion.getVersion())) {
|
||||||
Via.getPlatform().getLogger().warning("Duplicated blocked protocol version " + protocolVersion.getName() + "/" + protocolVersion.getVersion());
|
LOGGER.warning("Duplicated blocked protocol version " + protocolVersion.getName() + "/" + protocolVersion.getVersion());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,8 +210,7 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
|
|||||||
blockedProtocols.removeIf((IntPredicate) version -> {
|
blockedProtocols.removeIf((IntPredicate) version -> {
|
||||||
if (finalLowerBound != -1 && version < finalLowerBound || finalUpperBound != -1 && version > finalUpperBound) {
|
if (finalLowerBound != -1 && version < finalLowerBound || finalUpperBound != -1 && version > finalUpperBound) {
|
||||||
ProtocolVersion protocolVersion = ProtocolVersion.getProtocol(version);
|
ProtocolVersion protocolVersion = ProtocolVersion.getProtocol(version);
|
||||||
Via.getPlatform().getLogger().warning("Blocked protocol version "
|
LOGGER.warning("Blocked protocol version " + protocolVersion.getName() + "/" + protocolVersion.getVersion() + " already covered by upper or lower bound");
|
||||||
+ protocolVersion.getName() + "/" + protocolVersion.getVersion() + " already covered by upper or lower bound");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -223,7 +222,7 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
|
|||||||
private @Nullable ProtocolVersion protocolVersion(String s) {
|
private @Nullable ProtocolVersion protocolVersion(String s) {
|
||||||
ProtocolVersion protocolVersion = ProtocolVersion.getClosest(s);
|
ProtocolVersion protocolVersion = ProtocolVersion.getClosest(s);
|
||||||
if (protocolVersion == null) {
|
if (protocolVersion == null) {
|
||||||
Via.getPlatform().getLogger().warning("Unknown protocol version in block-versions: " + s);
|
LOGGER.warning("Unknown protocol version in block-versions: " + s);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return protocolVersion;
|
return protocolVersion;
|
||||||
|
@ -38,7 +38,7 @@ import org.yaml.snakeyaml.Yaml;
|
|||||||
|
|
||||||
@SuppressWarnings("VulnerableCodeUsages")
|
@SuppressWarnings("VulnerableCodeUsages")
|
||||||
public abstract class Config {
|
public abstract class Config {
|
||||||
private static final Logger LOGGER = Logger.getLogger("ViaVersion Config");
|
protected static final Logger LOGGER = Logger.getLogger("ViaVersion Config");
|
||||||
private static final YamlCompat YAMP_COMPAT = YamlCompat.isVersion1() ? new Yaml1Compat() : new Yaml2Compat();
|
private static final YamlCompat YAMP_COMPAT = YamlCompat.isVersion1() ? new Yaml1Compat() : new Yaml2Compat();
|
||||||
private static final ThreadLocal<Yaml> YAML = ThreadLocal.withInitial(() -> {
|
private static final ThreadLocal<Yaml> YAML = ThreadLocal.withInitial(() -> {
|
||||||
DumperOptions options = new DumperOptions();
|
DumperOptions options = new DumperOptions();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren