Switch to SLF4J logging.

This commit is contained in:
Kenzie Togami
2019-03-13 19:51:48 -07:00
parent 4191f017f1
commit d6804737cf
46 changed files with 247 additions and 318 deletions

View File

@ -21,6 +21,8 @@ package com.sk89q.worldedit.sponge.adapter;
import com.google.common.collect.Lists;
import com.sk89q.worldedit.util.io.Closer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
@ -30,15 +32,13 @@ import java.util.Enumeration;
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Loads Sponge implementation adapters.
*/
public class SpongeImplLoader {
private static final Logger log = Logger.getLogger(SpongeImplLoader.class.getCanonicalName());
private static final Logger log = LoggerFactory.getLogger(SpongeImplLoader.class);
private final List<String> adapterCandidates = new ArrayList<>();
private String customCandidate;
@ -71,7 +71,7 @@ public class SpongeImplLoader {
if (className != null) {
customCandidate = className;
adapterCandidates.add(className);
log.log(Level.INFO, "-Dworldedit.sponge.adapter used to add " + className + " to the list of available Sponge adapters");
log.info("-Dworldedit.sponge.adapter used to add " + className + " to the list of available Sponge adapters");
}
}
@ -157,18 +157,18 @@ public class SpongeImplLoader {
if (SpongeImplAdapter.class.isAssignableFrom(cls)) {
suitableAdapters.add((SpongeImplAdapter) cls.newInstance());
} else {
log.log(Level.WARNING, "Failed to load the Sponge adapter class '" + className +
log.warn("Failed to load the Sponge adapter class '" + className +
"' because it does not implement " + SpongeImplAdapter.class.getCanonicalName());
}
} catch (ClassNotFoundException e) {
log.log(Level.WARNING, "Failed to load the Sponge adapter class '" + className +
log.warn("Failed to load the Sponge adapter class '" + className +
"' that is not supposed to be missing", e);
} catch (IllegalAccessException e) {
log.log(Level.WARNING, "Failed to load the Sponge adapter class '" + className +
log.warn("Failed to load the Sponge adapter class '" + className +
"' that is not supposed to be raising this error", e);
} catch (Throwable e) {
if (className.equals(customCandidate)) {
log.log(Level.WARNING, "Failed to load the Sponge adapter class '" + className + "'", e);
log.warn("Failed to load the Sponge adapter class '" + className + "'", e);
}
}
}