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

@ -107,7 +107,7 @@ public class BlockState implements BlockStateHolder<BlockState> {
states.put(property, value, modifiedState);
} else {
System.out.println(stateMap);
WorldEdit.logger.warning("Found a null state at " + this.withValue(property, value));
WorldEdit.logger.warn("Found a null state at " + this.withValue(property, value));
}
}
});

View File

@ -36,12 +36,11 @@ import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.registry.LegacyMapper;
import com.sk89q.worldedit.world.storage.InvalidFormatException;
import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
public class AnvilChunk implements Chunk {
private CompoundTag rootTag;
@ -259,7 +258,7 @@ public class AnvilChunk implements Chunk {
BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(id, data);
if (state == null) {
WorldEdit.logger.warning("Unknown legacy block " + id + ":" + data + " found when loading legacy anvil chunk.");
WorldEdit.logger.warn("Unknown legacy block " + id + ":" + data + " found when loading legacy anvil chunk.");
return BlockTypes.AIR.getDefaultState().toBaseBlock();
}
CompoundTag tileEntity = getBlockTileEntity(position);

View File

@ -182,7 +182,7 @@ public class OldChunk implements Chunk {
BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(id, dataVal);
if (state == null) {
WorldEdit.logger.warning("Unknown legacy block " + id + ":" + dataVal + " found when loading legacy anvil chunk.");
WorldEdit.logger.warn("Unknown legacy block " + id + ":" + dataVal + " found when loading legacy anvil chunk.");
return BlockTypes.AIR.getDefaultState().toBaseBlock();
}

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());
}
}
}

View File

@ -29,11 +29,12 @@ import com.sk89q.worldedit.world.storage.TrueZipLegacyChunkStore;
import com.sk89q.worldedit.world.storage.TrueZipMcRegionChunkStore;
import com.sk89q.worldedit.world.storage.ZippedLegacyChunkStore;
import com.sk89q.worldedit.world.storage.ZippedMcRegionChunkStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.Calendar;
import java.util.logging.Logger;
import java.util.zip.ZipFile;
/**
@ -41,7 +42,7 @@ import java.util.zip.ZipFile;
*/
public class Snapshot implements Comparable<Snapshot> {
protected static Logger logger = Logger.getLogger(Snapshot.class.getCanonicalName());
protected static Logger logger = LoggerFactory.getLogger(Snapshot.class);
protected File file;
protected String name;