Skip to content

Commit

Permalink
change API logger to log4j2
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Feb 20, 2014
1 parent 5c4d01f commit 38dee74
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
22 changes: 12 additions & 10 deletions src/main/java/tconstruct/library/TConstructRegistry.java
Expand Up @@ -5,7 +5,9 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Logger;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import mantle.lib.TabTools;
import net.minecraft.item.Item;
Expand All @@ -31,7 +33,7 @@ public class TConstructRegistry
{
public static TConstructRegistry instance = new TConstructRegistry();

public static Logger logger = Logger.getLogger("TCon-API");
public static Logger logger = LogManager.getLogger("TCon-API");

/* Creative tabs */
public static TabTools toolTab;
Expand Down Expand Up @@ -70,7 +72,7 @@ public static void addItemToDirectory (String name, Item itemstack)
{
Item add = itemDirectory.get(name);
if (add != null)
logger.warning(name + " is already present in the Item directory");
logger.warn(name + " is already present in the Item directory");

itemDirectory.put(name, itemstack);
}
Expand All @@ -87,7 +89,7 @@ public static Item getItem (String name)
{
Item ret = itemDirectory.get(name);
if (ret == null)
logger.warning("Could not find " + name + " in the Item directory");
logger.warn("Could not find " + name + " in the Item directory");

return ret;
}
Expand Down Expand Up @@ -125,7 +127,7 @@ public static void addItemStackToDirectory (String name, ItemStack itemstack)
{
ItemStack add = itemstackDirectory.get(name);
if (add != null)
logger.warning(name + " is already present in the ItemStack directory");
logger.warn(name + " is already present in the ItemStack directory");

itemstackDirectory.put(name, itemstack);
}
Expand All @@ -142,7 +144,7 @@ public static ItemStack getItemStack (String name)
{
ItemStack ret = itemstackDirectory.get(name);
if (ret == null)
logger.warning("Could not find " + name + " in the ItemStack directory");
logger.warn("Could not find " + name + " in the ItemStack directory");

return ret;
}
Expand Down Expand Up @@ -221,7 +223,7 @@ public static void addToolRecipe (ToolCore output, Item... parts)
{
ToolBuilder tb = ToolBuilder.instance;
if (parts.length < 2 || parts.length > 4)
logger.warning("Wrong amount of items to craft into a tool");
logger.warn("Wrong amount of items to craft into a tool");

tb.addToolRecipe(output, parts);
}
Expand Down Expand Up @@ -493,7 +495,7 @@ LiquidCasting tableCasting ()
}
catch (Exception e)
{
logger.warning("Could not find casting table recipes.");
logger.warn("Could not find casting table recipes.");
return null;
}
}
Expand All @@ -514,7 +516,7 @@ LiquidCasting basinCasting ()
}
catch (Exception e)
{
logger.warning("Could not find casting basin recipes.");
logger.warn("Could not find casting basin recipes.");
return null;
}
}
Expand All @@ -535,7 +537,7 @@ Detailing chiselDetailing ()
}
catch (Exception e)
{
logger.warning("Could not find chisel detailing recipes.");
logger.warn("Could not find chisel detailing recipes.");
return null;
}
}
Expand Down
16 changes: 6 additions & 10 deletions src/main/java/tconstruct/library/tools/ToolCore.java
Expand Up @@ -58,8 +58,8 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
{
// TE power constants -- TODO grab these from the items added
protected int capacity = 400000;
protected int maxReceive = 75;
protected int maxExtract = 75;
protected int maxReceive = 80;
protected int maxExtract = 80;

protected Random random = new Random();
protected int damageVsEntity;
Expand Down Expand Up @@ -546,23 +546,19 @@ public void buildTool (int id, String name, List list)
boolean supress = false;
try
{
clazz = Class.forName("tconstruct.common.TRepo"); // TODO: Make
// sure this
// is still
// working
// in 1.7.
clazz = Class.forName("tconstruct.common.TRepo");
fld = clazz.getField("supressMissingToolLogs");
supress = fld.getBoolean(fld);
}
catch (Exception e)
{
TConstructRegistry.logger.severe("TConstruct Library could not find parts of TContent");
TConstructRegistry.logger.error("TConstruct Library could not find parts of TContent");
e.printStackTrace();
}
if (!supress)
{
TConstructRegistry.logger.severe("Creative builder failed tool for " + name + this.getToolName());
TConstructRegistry.logger.severe("Make sure you do not have item ID conflicts");
TConstructRegistry.logger.error("Creative builder failed tool for " + name + this.getToolName());
TConstructRegistry.logger.error("Make sure you do not have item ID conflicts");
}
}
else
Expand Down

0 comments on commit 38dee74

Please sign in to comment.