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

@ -25,17 +25,16 @@ import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.util.gson.VectorAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
/**
* Provides block data based on the built-in block database that is bundled
@ -50,7 +49,7 @@ import javax.annotation.Nullable;
*/
public class BundledBlockData {
private static final Logger log = Logger.getLogger(BundledBlockData.class.getCanonicalName());
private static final Logger log = LoggerFactory.getLogger(BundledBlockData.class);
private static BundledBlockData INSTANCE;
private final Map<String, BlockEntry> idMap = new HashMap<>();
@ -62,7 +61,7 @@ public class BundledBlockData {
try {
loadFromResource();
} catch (Throwable e) {
log.log(Level.WARNING, "Failed to load the built-in block registry", e);
log.warn("Failed to load the built-in block registry", e);
}
}

View File

@ -25,17 +25,16 @@ import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.util.gson.VectorAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
/**
* Provides item data based on the built-in item database that is bundled
@ -50,7 +49,7 @@ import javax.annotation.Nullable;
*/
public class BundledItemData {
private static final Logger log = Logger.getLogger(BundledItemData.class.getCanonicalName());
private static final Logger log = LoggerFactory.getLogger(BundledItemData.class);
private static BundledItemData INSTANCE;
private final Map<String, ItemEntry> idMap = new HashMap<>();
@ -62,7 +61,7 @@ public class BundledItemData {
try {
loadFromResource();
} catch (Throwable e) {
log.log(Level.WARNING, "Failed to load the built-in item registry", e);
log.warn("Failed to load the built-in item registry", e);
}
}

View File

@ -32,22 +32,21 @@ import com.sk89q.worldedit.util.gson.VectorAdapter;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;
public class LegacyMapper {
private static final Logger log = Logger.getLogger(LegacyMapper.class.getCanonicalName());
private static final Logger log = LoggerFactory.getLogger(LegacyMapper.class);
private static LegacyMapper INSTANCE;
private Multimap<String, BlockState> stringToBlockMap = HashMultimap.create();
@ -62,7 +61,7 @@ public class LegacyMapper {
try {
loadFromResource();
} catch (Throwable e) {
log.log(Level.WARNING, "Failed to load the built-in legacy id registry", e);
log.warn("Failed to load the built-in legacy id registry", e);
}
}
@ -94,7 +93,7 @@ public class LegacyMapper {
blockToStringMap.put(state, id);
stringToBlockMap.put(id, state);
} catch (Exception e) {
log.warning("Unknown block: " + blockEntry.getValue());
log.warn("Unknown block: " + blockEntry.getValue());
}
}
@ -106,7 +105,7 @@ public class LegacyMapper {
itemToStringMap.put(type, id);
stringToItemMap.put(id, type);
} catch (Exception e) {
log.warning("Unknown item: " + itemEntry.getValue());
log.warn("Unknown item: " + itemEntry.getValue());
}
}
}