From 37adec2afe0cb55b428e216a111c86ecca1b98b0 Mon Sep 17 00:00:00 2001 From: Parker Date: Sat, 2 Aug 2014 11:32:04 -0400 Subject: [PATCH] Updated logging to log4j2 --- .../api/blueprints/MappingRegistry.java | 9 ++++---- api/buildcraft/api/core/BCLog.java | 16 +++++++------- api/buildcraft/api/mj/BatteryObject.java | 13 ++++++------ api/buildcraft/api/mj/MjAPI.java | 9 ++++---- api/buildcraft/api/mj/MjReconfigurator.java | 2 +- common/buildcraft/BuildCraftEnergy.java | 7 ++++--- common/buildcraft/BuildCraftMod.java | 11 +++++----- common/buildcraft/core/Version.java | 10 ++++----- .../buildcraft/core/blueprints/Blueprint.java | 2 +- .../core/blueprints/BlueprintBase.java | 2 +- .../core/blueprints/BptBuilderBase.java | 5 +++-- .../core/blueprints/BptBuilderBlueprint.java | 21 +++++++++---------- .../buildcraft/core/blueprints/BptError.java | 2 +- common/buildcraft/core/utils/ConfigUtils.java | 8 +++---- .../factory/FactoryProxyClient.java | 4 ++-- .../transport/BlockGenericPipe.java | 4 ++-- common/buildcraft/transport/GuiHandler.java | 6 +++--- common/buildcraft/transport/ItemPipe.java | 5 +++-- .../transport/PipeTransportItems.java | 7 ++++--- .../buildcraft/transport/TileGenericPipe.java | 11 +++++----- 20 files changed, 81 insertions(+), 73 deletions(-) diff --git a/api/buildcraft/api/blueprints/MappingRegistry.java b/api/buildcraft/api/blueprints/MappingRegistry.java index 9bdc6e7c..5858b71b 100755 --- a/api/buildcraft/api/blueprints/MappingRegistry.java +++ b/api/buildcraft/api/blueprints/MappingRegistry.java @@ -10,7 +10,8 @@ package buildcraft.api.blueprints; import java.util.ArrayList; import java.util.HashMap; -import java.util.logging.Level; + +import org.apache.logging.log4j.Level; import net.minecraft.block.Block; import net.minecraft.entity.Entity; @@ -285,7 +286,7 @@ public class MappingRegistry { } else { // Keeping the order correct idToBlock.add(null); - BCLog.logger.log(Level.WARNING, "Can't load block " + name); + BCLog.logger.log(Level.WARN, "Can't load block " + name); } } @@ -302,7 +303,7 @@ public class MappingRegistry { } else { // Keeping the order correct idToItem.add(null); - BCLog.logger.log(Level.WARNING, "Can't load item " + name); + BCLog.logger.log(Level.WARN, "Can't load item " + name); } } @@ -325,7 +326,7 @@ public class MappingRegistry { } else { // Keeping the order correct idToEntity.add(null); - BCLog.logger.log(Level.WARNING, "Can't load entity " + name); + BCLog.logger.log(Level.WARN, "Can't load entity " + name); } } } diff --git a/api/buildcraft/api/core/BCLog.java b/api/buildcraft/api/core/BCLog.java index 3ccdac2e..4e5eada5 100644 --- a/api/buildcraft/api/core/BCLog.java +++ b/api/buildcraft/api/core/BCLog.java @@ -9,12 +9,14 @@ package buildcraft.api.core; import java.lang.reflect.Method; -import java.util.logging.Level; -import java.util.logging.Logger; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public final class BCLog { - public static final Logger logger = Logger.getLogger("Buildcraft"); + public static final Logger logger = LogManager.getLogger("BuildCraft"); /** * Deactivate constructor @@ -23,11 +25,9 @@ public final class BCLog { } public static void initLog() { - // TODO: check if the code below is still useful and remove otherwise. - //logger.setParent(FMLLog.getLogger()); logger.info("Starting BuildCraft " + getVersion()); - logger.info("Copyright (c) SpaceToad, 2011"); + logger.info("Copyright (c) SpaceToad, 2011-2014"); logger.info("http://www.mod-buildcraft.com"); } @@ -39,12 +39,12 @@ public final class BCLog { msg.append(", ").append(stackTrace[0]); } - logger.log(Level.SEVERE, msg.toString()); + logger.log(Level.ERROR, msg.toString()); if (classFile != null) { msg = new StringBuilder(mod); msg.append(" API error: ").append(classFile.getSimpleName()).append(" is loaded from ").append(classFile.getProtectionDomain().getCodeSource().getLocation()); - logger.log(Level.SEVERE, msg.toString()); + logger.log(Level.ERROR, msg.toString()); } } diff --git a/api/buildcraft/api/mj/BatteryObject.java b/api/buildcraft/api/mj/BatteryObject.java index f0dd5680..8e225371 100755 --- a/api/buildcraft/api/mj/BatteryObject.java +++ b/api/buildcraft/api/mj/BatteryObject.java @@ -9,7 +9,8 @@ package buildcraft.api.mj; import java.lang.reflect.Field; -import java.util.logging.Level; + +import org.apache.logging.log4j.Level; import buildcraft.api.core.BCLog; import buildcraft.api.core.JavaTools; @@ -36,7 +37,7 @@ public class BatteryObject implements IBatteryIOObject, MjReconfigurator.IConfig return JavaTools.bounds(batteryData.maxCapacity() - energyStored.getDouble(obj), batteryData.minimumConsumption(), batteryData.maxReceivedPerCycle()); } catch (IllegalAccessException e) { - BCLog.logger.log(Level.WARNING, "can't get energy requested", e); + BCLog.logger.log(Level.WARN, "can't get energy requested", e); } return 0; } @@ -66,7 +67,7 @@ public class BatteryObject implements IBatteryIOObject, MjReconfigurator.IConfig return used; } } catch (IllegalAccessException e) { - BCLog.logger.log(Level.WARNING, "can't add energy", e); + BCLog.logger.log(Level.WARN, "can't add energy", e); } return 0; } @@ -90,7 +91,7 @@ public class BatteryObject implements IBatteryIOObject, MjReconfigurator.IConfig return used; } } catch (IllegalAccessException e) { - BCLog.logger.log(Level.WARNING, "can't extract energy", e); + BCLog.logger.log(Level.WARN, "can't extract energy", e); } return 0; } @@ -103,7 +104,7 @@ public class BatteryObject implements IBatteryIOObject, MjReconfigurator.IConfig try { return energyStored.getDouble(obj); } catch (IllegalAccessException e) { - BCLog.logger.log(Level.WARNING, "can't get return energy stored", e); + BCLog.logger.log(Level.WARN, "can't get return energy stored", e); return 0; } } @@ -116,7 +117,7 @@ public class BatteryObject implements IBatteryIOObject, MjReconfigurator.IConfig try { energyStored.setDouble(obj, mj); } catch (IllegalAccessException e) { - BCLog.logger.log(Level.WARNING, "can't set energy stored", e); + BCLog.logger.log(Level.WARN, "can't set energy stored", e); throw new RuntimeException(e); } } diff --git a/api/buildcraft/api/mj/MjAPI.java b/api/buildcraft/api/mj/MjAPI.java index d8333e3a..a366fd8b 100755 --- a/api/buildcraft/api/mj/MjAPI.java +++ b/api/buildcraft/api/mj/MjAPI.java @@ -13,7 +13,8 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.WeakHashMap; -import java.util.logging.Level; + +import org.apache.logging.log4j.Level; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; @@ -139,10 +140,10 @@ public final class MjAPI { obj.init(o, f.field, f.battery); return obj; } catch (InstantiationException e) { - BCLog.logger.log(Level.WARNING, "can't instantiate class for energy kind \"" + kind + "\""); + BCLog.logger.log(Level.WARN, "can't instantiate class for energy kind \"" + kind + "\""); return null; } catch (IllegalAccessException e) { - BCLog.logger.log(Level.WARNING, "can't instantiate class for energy kind \"" + kind + "\""); + BCLog.logger.log(Level.WARN, "can't instantiate class for energy kind \"" + kind + "\""); return null; } } else { @@ -191,7 +192,7 @@ public final class MjAPI { if (!mjBatteryKinds.containsKey(kind)) { mjBatteryKinds.put(kind, clazz); } else { - BCLog.logger.log(Level.WARNING, + BCLog.logger.log(Level.WARN, "energy kind \"" + kind + "\" already registered with " + clazz.getCanonicalName()); } } diff --git a/api/buildcraft/api/mj/MjReconfigurator.java b/api/buildcraft/api/mj/MjReconfigurator.java index e5e81dcc..87e3704c 100644 --- a/api/buildcraft/api/mj/MjReconfigurator.java +++ b/api/buildcraft/api/mj/MjReconfigurator.java @@ -86,7 +86,7 @@ public class MjReconfigurator { private ConfigurableMjBattery obtainConfigurableBattery(IBatteryObject battery) { if (!(battery instanceof IConfigurableBatteryObject)) { - BCLog.logger.warning("Attempt to reconfigure unsupported battery: " + battery); + BCLog.logger.warn("Attempt to reconfigure unsupported battery: " + battery); return null; } IConfigurableBatteryObject configurableBattery = (IConfigurableBatteryObject) battery; diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java index 1817482f..616f07d6 100644 --- a/common/buildcraft/BuildCraftEnergy.java +++ b/common/buildcraft/BuildCraftEnergy.java @@ -11,7 +11,8 @@ package buildcraft; import java.util.HashSet; import java.util.Set; import java.util.TreeMap; -import java.util.logging.Level; + +import org.apache.logging.log4j.Level; import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; @@ -309,7 +310,7 @@ public class BuildCraftEnergy extends BuildCraftMod { list.add(Integer.parseInt(strippedId)); } catch (NumberFormatException ex) { BCLog.logger.log - (Level.WARNING, + (Level.WARN, configuration.getName() + ": Could not find biome id: " + strippedId + " ; Skipping!"); } @@ -332,7 +333,7 @@ public class BuildCraftEnergy extends BuildCraftMod { if (!found) { BCLog.logger.log - (Level.WARNING, + (Level.WARN, configuration.getName() + ": Could not find biome id: " + strippedId + " ; Skipping!"); } diff --git a/common/buildcraft/BuildCraftMod.java b/common/buildcraft/BuildCraftMod.java index 2bf7a4b2..648e7780 100755 --- a/common/buildcraft/BuildCraftMod.java +++ b/common/buildcraft/BuildCraftMod.java @@ -9,7 +9,8 @@ package buildcraft; import java.util.EnumMap; -import java.util.logging.Level; + +import org.apache.logging.log4j.Level; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.Packet; @@ -32,7 +33,7 @@ public class BuildCraftMod { .set(FMLOutboundHandler.OutboundTarget.ALL); channels.get(Side.SERVER).writeOutbound(packet); } catch (Throwable t) { - BCLog.logger.log(Level.WARNING, "sentToPlayers crash", t); + BCLog.logger.log(Level.WARN, "sentToPlayers crash", t); } } @@ -42,7 +43,7 @@ public class BuildCraftMod { .set(FMLOutboundHandler.OutboundTarget.ALL); channels.get(Side.SERVER).writeOutbound(packet); } catch (Throwable t) { - BCLog.logger.log(Level.WARNING, "sentToPlayers crash", t); + BCLog.logger.log(Level.WARN, "sentToPlayers crash", t); } } @@ -59,7 +60,7 @@ public class BuildCraftMod { name = ""; } - BCLog.logger.log(Level.WARNING, "sentToPlayer \"" + name + "\" crash", t); + BCLog.logger.log(Level.WARN, "sentToPlayer \"" + name + "\" crash", t); } } @@ -68,7 +69,7 @@ public class BuildCraftMod { channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.TOSERVER); channels.get(Side.CLIENT).writeOutbound(packet); } catch (Throwable t) { - BCLog.logger.log(Level.WARNING, "sentToServer crash", t); + BCLog.logger.log(Level.WARN, "sentToServer crash", t); } } } \ No newline at end of file diff --git a/common/buildcraft/core/Version.java b/common/buildcraft/core/Version.java index 61730b9c..055b19f3 100644 --- a/common/buildcraft/core/Version.java +++ b/common/buildcraft/core/Version.java @@ -116,7 +116,7 @@ public class Version implements Runnable { recommendedVersion = tokens[2]; if (VERSION.matches(tokens[2])) { - BCLog.logger.finer("Using the latest version [" + getVersion() + "] for Minecraft " + mcVersion); + BCLog.logger.trace("Using the latest version [" + getVersion() + "] for Minecraft " + mcVersion); currentVersion = EnumUpdateState.CURRENT; return; } @@ -124,7 +124,7 @@ public class Version implements Runnable { } } - BCLog.logger.warning("Using outdated version [" + VERSION + "] for Minecraft " + mcVersion + BCLog.logger.warn("Using outdated version [" + VERSION + "] for Minecraft " + mcVersion + ". Consider updating to " + recommendedVersion + "."); currentVersion = EnumUpdateState.OUTDATED; sendIMCOutdatedMessage(); @@ -132,8 +132,8 @@ public class Version implements Runnable { conn.disconnect(); reader.close(); } catch (Exception e) { - BCLog.logger.warning("Unable to read from remote version authority."); - BCLog.logger.warning(e.toString()); + BCLog.logger.warn("Unable to read from remote version authority."); + BCLog.logger.warn(e.toString()); currentVersion = EnumUpdateState.CONNECTION_ERROR; } } @@ -187,7 +187,7 @@ public class Version implements Runnable { } catch (Exception ex) { ex.printStackTrace(); - BCLog.logger.warning("Unable to read changelog from remote site."); + BCLog.logger.warn("Unable to read changelog from remote site."); } return new String[]{String.format("Unable to retrieve changelog for %s %s", DefaultProps.MOD, version)}; diff --git a/common/buildcraft/core/blueprints/Blueprint.java b/common/buildcraft/core/blueprints/Blueprint.java index b19700aa..f94fe850 100644 --- a/common/buildcraft/core/blueprints/Blueprint.java +++ b/common/buildcraft/core/blueprints/Blueprint.java @@ -113,7 +113,7 @@ public class Blueprint extends BlueprintBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBlueprint", "readFromWorld", t); + BCLog.logger.throwing(t); } switch (slot.getBuildingPermission()) { diff --git a/common/buildcraft/core/blueprints/BlueprintBase.java b/common/buildcraft/core/blueprints/BlueprintBase.java index f14d5629..d41872ec 100644 --- a/common/buildcraft/core/blueprints/BlueprintBase.java +++ b/common/buildcraft/core/blueprints/BlueprintBase.java @@ -96,7 +96,7 @@ public abstract class BlueprintBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBase", "rotateLeft", t); + BCLog.logger.throwing(t); } } } diff --git a/common/buildcraft/core/blueprints/BptBuilderBase.java b/common/buildcraft/core/blueprints/BptBuilderBase.java index 49a63b7f..f981c544 100644 --- a/common/buildcraft/core/blueprints/BptBuilderBase.java +++ b/common/buildcraft/core/blueprints/BptBuilderBase.java @@ -11,7 +11,8 @@ package buildcraft.core.blueprints; import java.util.ArrayList; import java.util.LinkedList; import java.util.TreeSet; -import java.util.logging.Level; + +import org.apache.logging.log4j.Level; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -267,7 +268,7 @@ public abstract class BptBuilderBase implements IAreaProvider { item.context = getContext(); builder.getBuilders().add(item); } catch (MappingNotFoundException e) { - BCLog.logger.log(Level.WARNING, "can't load building item", e); + BCLog.logger.log(Level.WARN, "can't load building item", e); } } } diff --git a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java index 79c11e30..6f8e2817 100644 --- a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java +++ b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java @@ -209,7 +209,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", "checkRequirements", t); + BCLog.logger.throwing(t); } b.writeToWorld(context); @@ -228,7 +228,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", "checkRequirements", t); + BCLog.logger.throwing(t); } e.writeToWorld(context); @@ -416,8 +416,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", - "internalGetBlock", t); + BCLog.logger.throwing(t); iterator.remove(); } } @@ -465,7 +464,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", "checkRequirements", t); + BCLog.logger.throwing(t); } LinkedList stacksUsed = new LinkedList(); @@ -505,7 +504,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", "checkRequirements", t); + BCLog.logger.throwing(t); } if (reqStk.stackSize == 0) { @@ -539,7 +538,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", "useRequirements", t); + BCLog.logger.throwing(t); } @@ -590,7 +589,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", "useRequirements", t); + BCLog.logger.throwing(t); } if (reqStk.stackSize == 0) { @@ -622,7 +621,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", "recomputeIfNeeded", t); + BCLog.logger.throwing(t); } for (ItemStack stack : stacks) { @@ -651,7 +650,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", "recomputeIfNeeded", t); + BCLog.logger.throwing(t); } for (ItemStack stack : stacks) { @@ -713,7 +712,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - BCLog.logger.throwing("BptBuilderBlueprint", "postProcessing", t); + BCLog.logger.throwing(t); } } } diff --git a/common/buildcraft/core/blueprints/BptError.java b/common/buildcraft/core/blueprints/BptError.java index 9fc93b01..3a3bb990 100644 --- a/common/buildcraft/core/blueprints/BptError.java +++ b/common/buildcraft/core/blueprints/BptError.java @@ -20,7 +20,7 @@ public class BptError extends Exception { public BptError(String str) { super(str); - BCLog.logger.fine("BLUEPRINT ERROR:" + str); + BCLog.logger.debug("BLUEPRINT ERROR:" + str); } diff --git a/common/buildcraft/core/utils/ConfigUtils.java b/common/buildcraft/core/utils/ConfigUtils.java index 1a2b329d..b1b7d421 100644 --- a/common/buildcraft/core/utils/ConfigUtils.java +++ b/common/buildcraft/core/utils/ConfigUtils.java @@ -8,7 +8,7 @@ */ package buildcraft.core.utils; -import java.util.logging.Level; +import org.apache.logging.log4j.Level; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; @@ -80,7 +80,7 @@ public class ConfigUtils { try { parsed = Boolean.parseBoolean(value); } catch (NumberFormatException ex) { - BCLog.logger.log(Level.WARNING, "Failed to parse config tag, reseting to default: " + prop.getName(), ex); + BCLog.logger.log(Level.WARN, "Failed to parse config tag, reseting to default: " + prop.getName(), ex); prop.set(defaultValue); return defaultValue; } @@ -93,7 +93,7 @@ public class ConfigUtils { try { parsed = Integer.parseInt(value); } catch (NumberFormatException ex) { - BCLog.logger.log(Level.WARNING, "Failed to parse config tag, reseting to default: " + prop.getName(), ex); + BCLog.logger.log(Level.WARN, "Failed to parse config tag, reseting to default: " + prop.getName(), ex); prop.set(defaultValue); return defaultValue; } @@ -106,7 +106,7 @@ public class ConfigUtils { try { parsed = Double.parseDouble(value); } catch (NumberFormatException ex) { - BCLog.logger.log(Level.WARNING, "Failed to parse config tag, reseting to default: " + prop.getName(), ex); + BCLog.logger.log(Level.WARN, "Failed to parse config tag, reseting to default: " + prop.getName(), ex); prop.set(defaultValue); return defaultValue; } diff --git a/common/buildcraft/factory/FactoryProxyClient.java b/common/buildcraft/factory/FactoryProxyClient.java index 750d5e31..c109f869 100644 --- a/common/buildcraft/factory/FactoryProxyClient.java +++ b/common/buildcraft/factory/FactoryProxyClient.java @@ -66,9 +66,9 @@ public class FactoryProxyClient extends FactoryProxy { Class neiRenderer = Class.forName("codechicken.nei.DefaultOverlayRenderer"); Method method = neiRenderer.getMethod("registerGuiOverlay", Class.class, String.class, int.class, int.class); method.invoke(null, GuiAutoCrafting.class, "crafting", 5, 11); - BCLog.logger.fine("NEI detected, adding NEI overlay"); + BCLog.logger.debug("NEI detected, adding NEI overlay"); } catch (Exception e) { - BCLog.logger.fine("NEI not detected."); + BCLog.logger.debug("NEI not detected."); } } diff --git a/common/buildcraft/transport/BlockGenericPipe.java b/common/buildcraft/transport/BlockGenericPipe.java index 5b79b3d9..f0da3d74 100644 --- a/common/buildcraft/transport/BlockGenericPipe.java +++ b/common/buildcraft/transport/BlockGenericPipe.java @@ -1096,12 +1096,12 @@ public class BlockGenericPipe extends BlockBuildCraft { if (pipe != null) { return pipe.getConstructor(Item.class).newInstance(key); } else { - BCLog.logger.warning("Detected pipe with unknown key (" + key + "). Did you remove a buildcraft addon?"); + BCLog.logger.warn("Detected pipe with unknown key (" + key + "). Did you remove a buildcraft addon?"); } } catch (Throwable t) { t.printStackTrace(); - BCLog.logger.warning("Failed to create pipe with (" + key + "). No valid constructor found. Possibly a item ID conflit."); + BCLog.logger.warn("Failed to create pipe with (" + key + "). No valid constructor found. Possibly a item ID conflit."); } return null; diff --git a/common/buildcraft/transport/GuiHandler.java b/common/buildcraft/transport/GuiHandler.java index bf34a1b2..9344b4be 100644 --- a/common/buildcraft/transport/GuiHandler.java +++ b/common/buildcraft/transport/GuiHandler.java @@ -8,7 +8,7 @@ */ package buildcraft.transport; -import java.util.logging.Level; +import org.apache.logging.log4j.Level; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; @@ -75,7 +75,7 @@ public class GuiHandler implements IGuiHandler { return null; } } catch (Exception ex) { - BCLog.logger.log(Level.SEVERE, "Failed to open GUI", ex); + BCLog.logger.log(Level.ERROR, "Failed to open GUI", ex); } return null; } @@ -121,7 +121,7 @@ public class GuiHandler implements IGuiHandler { return null; } } catch (Exception ex) { - BCLog.logger.log(Level.SEVERE, "Failed to open GUI", ex); + BCLog.logger.log(Level.ERROR, "Failed to open GUI", ex); } return null; } diff --git a/common/buildcraft/transport/ItemPipe.java b/common/buildcraft/transport/ItemPipe.java index 0f2a81d8..8237dbc7 100644 --- a/common/buildcraft/transport/ItemPipe.java +++ b/common/buildcraft/transport/ItemPipe.java @@ -9,7 +9,8 @@ package buildcraft.transport; import java.util.List; -import java.util.logging.Level; + +import org.apache.logging.log4j.Level; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; @@ -83,7 +84,7 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe { Pipe pipe = BlockGenericPipe.createPipe(this); if (pipe == null) { - BCLog.logger.log(Level.WARNING, "Pipe failed to create during placement at {0},{1},{2}", new Object[]{i, j, k}); + BCLog.logger.log(Level.WARN, "Pipe failed to create during placement at {0},{1},{2}", new Object[]{i, j, k}); return true; } diff --git a/common/buildcraft/transport/PipeTransportItems.java b/common/buildcraft/transport/PipeTransportItems.java index 69ec1521..5d280c5d 100644 --- a/common/buildcraft/transport/PipeTransportItems.java +++ b/common/buildcraft/transport/PipeTransportItems.java @@ -12,7 +12,8 @@ import java.util.Collections; import java.util.EnumSet; import java.util.LinkedList; import java.util.List; -import java.util.logging.Level; + +import org.apache.logging.log4j.Level; import net.minecraft.entity.item.EntityItem; import net.minecraft.inventory.IInventory; @@ -120,7 +121,7 @@ public class PipeTransportItems extends PipeTransport { } if (items.size() > MAX_PIPE_STACKS) { - BCLog.logger.log(Level.WARNING, String.format("Pipe exploded at %d,%d,%d because it had too many stacks: %d", container.xCoord, container.yCoord, container.zCoord, items.size())); + BCLog.logger.log(Level.WARN, String.format("Pipe exploded at %d,%d,%d because it had too many stacks: %d", container.xCoord, container.yCoord, container.zCoord, items.size())); destroyPipe(); return; } @@ -134,7 +135,7 @@ public class PipeTransportItems extends PipeTransport { } if (numItems > MAX_PIPE_ITEMS) { - BCLog.logger.log(Level.WARNING, String.format("Pipe exploded at %d,%d,%d because it had too many items: %d", container.xCoord, container.yCoord, container.zCoord, numItems)); + BCLog.logger.log(Level.WARN, String.format("Pipe exploded at %d,%d,%d because it had too many items: %d", container.xCoord, container.yCoord, container.zCoord, numItems)); destroyPipe(); } } diff --git a/common/buildcraft/transport/TileGenericPipe.java b/common/buildcraft/transport/TileGenericPipe.java index e20e6ad3..b157ba5a 100755 --- a/common/buildcraft/transport/TileGenericPipe.java +++ b/common/buildcraft/transport/TileGenericPipe.java @@ -9,7 +9,8 @@ package buildcraft.transport; import java.util.LinkedList; -import java.util.logging.Level; + +import org.apache.logging.log4j.Level; import io.netty.buffer.ByteBuf; @@ -153,14 +154,14 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui NBTTagCompound pluggableData = nbt.getCompoundTag(key); Class pluggableClass = Class.forName(pluggableData.getString("pluggableClass")); if (!IPipePluggable.class.isAssignableFrom(pluggableClass)) { - BCLog.logger.warning("Wrong pluggable class: " + pluggableClass); + BCLog.logger.warn("Wrong pluggable class: " + pluggableClass); continue; } IPipePluggable pluggable = (IPipePluggable) pluggableClass.newInstance(); pluggable.readFromNBT(pluggableData); pluggables[i] = pluggable; } catch (Exception e) { - BCLog.logger.warning("Failed to load side state"); + BCLog.logger.warn("Failed to load side state"); e.printStackTrace(); } } @@ -302,7 +303,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui if (pipe != null) { pipe.readFromNBT(nbt); } else { - BCLog.logger.log(Level.WARNING, "Pipe failed to load from NBT at {0},{1},{2}", new Object[]{xCoord, yCoord, zCoord}); + BCLog.logger.log(Level.WARN, "Pipe failed to load from NBT at {0},{1},{2}", new Object[]{xCoord, yCoord, zCoord}); deletePipe = true; } @@ -532,7 +533,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui this.blockType = getBlockType(); if (pipe == null) { - BCLog.logger.log(Level.WARNING, "Pipe failed to initialize at {0},{1},{2}, deleting", new Object[]{xCoord, yCoord, zCoord}); + BCLog.logger.log(Level.WARN, "Pipe failed to initialize at {0},{1},{2}, deleting", new Object[]{xCoord, yCoord, zCoord}); worldObj.setBlockToAir(xCoord, yCoord, zCoord); return; }