Clean up logging and log spam. #cleanloginitiative

This commit is contained in:
Vincent Lee committed 2016-06-04 19:01:34 -05:00
1 parent d241f95bee
commit 05c6a07bc2
14 files changed
+66 -70

No files matched your search

@@ -3,8 +3,8 @@ package vazkii.botania.client.core.handler;
import com.google.common.base.Throwables;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import vazkii.botania.common.Botania;
import vazkii.botania.common.lib.LibObfuscation;
import java.lang.invoke.MethodHandle;
@@ -67,7 +67,7 @@ public final class ClientMethodHandles {
// f.setAccessible(true);
// equippedProgress_getter = MethodHandles.publicLookup().unreflectGetter(f);
} catch (IllegalAccessException e) {
FMLLog.severe("[Botania]: Couldn't initialize client methodhandles! Things will be broken!");
Botania.LOGGER.fatal("Couldn't initialize client methodhandles! Things will be broken!");
e.printStackTrace();
throw Throwables.propagate(e);
}
@@ -21,13 +21,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.FMLLog;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.api.item.IBaubleRender.Helper;
import vazkii.botania.api.subtile.signature.SubTileSignature;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.core.version.VersionChecker;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
@@ -208,7 +208,7 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
load(props);
}
} catch (IOException e) {
FMLLog.info("[Botania] Could not load contributors list. Either you're offline or github is down. Nothing to worry about, carry on~");
Botania.LOGGER.info("Could not load contributors list. Either you're offline or github is down. Nothing to worry about, carry on~");
}
VersionChecker.doneChecking = true;
}
@@ -17,7 +17,6 @@ import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.apache.commons.lang3.text.WordUtils;
import org.lwjgl.BufferUtils;
@@ -27,6 +26,7 @@ import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.client.model.FloatingFlowerModel;
import vazkii.botania.client.model.LexiconModel;
import vazkii.botania.client.model.PlatformModel;
import vazkii.botania.common.Botania;
import vazkii.botania.common.integration.buildcraft.TriggerManaLevel;
import vazkii.botania.common.item.ItemSparkUpgrade;
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
@@ -161,7 +161,7 @@ public class MiscellaneousIcons {
int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
FMLLog.info("[Botania]: Dumped atlas %d wide by %d tall%n", width, height);
Botania.LOGGER.debug("Dumped atlas %d wide by %d tall%n", width, height);
int pixels = width * height;
@@ -191,7 +191,7 @@ public class MiscellaneousIcons {
try {
ImageIO.write(bufferedimage, "png", result);
} catch (IOException e) {
FMLLog.warning("[Botania]: Failed to dump debug atlas");
Botania.LOGGER.warn("Failed to dump debug atlas");
}
}
@@ -17,11 +17,11 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.client.event.RenderHandEvent;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.util.glu.Project;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.core.helper.PlayerHelper;
import vazkii.botania.common.item.ItemLexicon;
@@ -95,8 +95,7 @@ public class RenderLexicon {
}
// End EntityRenderer.renderHand copy
} catch (Throwable throwable) {
FMLLog.warning("[Botania]: Failed to render lexicon");
throwable.printStackTrace();
Botania.LOGGER.warn("Failed to render lexicon");
}
}
@@ -11,8 +11,6 @@
package vazkii.botania.client.core.helper;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.logging.log4j.Level;
import org.lwjgl.opengl.ARBFragmentShader;
import org.lwjgl.opengl.ARBShaderObjects;
import org.lwjgl.opengl.ARBVertexShader;
@@ -20,6 +18,7 @@ import org.lwjgl.opengl.GL11;
import vazkii.botania.api.internal.ShaderCallback;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.handler.ConfigHandler;
import java.io.BufferedReader;
@@ -109,13 +108,13 @@ public final class ShaderHelper {
ARBShaderObjects.glLinkProgramARB(program);
if(ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) {
FMLLog.log(Level.ERROR, getLogInfo(program));
Botania.LOGGER.error(getLogInfo(program));
return 0;
}
ARBShaderObjects.glValidateProgramARB(program);
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) {
FMLLog.log(Level.ERROR, getLogInfo(program));
Botania.LOGGER.error(getLogInfo(program));
return 0;
}
@@ -30,7 +30,6 @@ import net.minecraftforge.client.model.animation.AnimationTESR;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@@ -103,6 +102,7 @@ import vazkii.botania.client.render.tile.RenderTileTerraPlate;
import vazkii.botania.client.render.tile.RenderTileTeruTeruBozu;
import vazkii.botania.client.render.tile.RenderTileTinyPotato;
import vazkii.botania.client.render.world.SkyblockRenderEvents;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.tile.TileAlfPortal;
import vazkii.botania.common.block.tile.TileAltar;
import vazkii.botania.common.block.tile.TileAvatar;
@@ -173,8 +173,7 @@ public class ClientProxy extends CommonProxy {
PersistentVariableHelper.load();
PersistentVariableHelper.save();
} catch (IOException e) {
FMLLog.severe("Botania's persistent Variables couldn't load!");
e.printStackTrace();
Botania.LOGGER.fatal("Persistent Variables couldn't load!!");
}
super.preInit(event);
@@ -35,10 +35,10 @@ import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.client.model.pipeline.VertexTransformer;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.fml.common.FMLLog;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
@@ -132,7 +132,7 @@ public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadL
// Enhance!
CompositeBakedModel model = new CompositeBakedModel(flowerModel, islandModel);
FMLLog.info("[Botania]: Cached floating flower model for islandtype %s and flowertype %s", islandType, identifier);
Botania.LOGGER.debug("Cached floating flower model for islandtype %s and flowertype %s", islandType, identifier);
CACHE.put(islandType, identifier, model);
return model;
}
@@ -41,10 +41,10 @@ import net.minecraftforge.client.model.SimpleModelState;
import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.commons.lang3.tuple.Pair;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
@@ -127,7 +127,7 @@ public class SpecialFlowerModel implements IModelCustomData {
if(e.isJsonPrimitive() && e.getAsJsonPrimitive().isString()) {
return new ModelResourceLocation(e.getAsString());
}
FMLLog.severe("Expect ModelResourceLocation, got: ", json);
Botania.LOGGER.error("Expect ModelResourceLocation, got: ", json);
return new ModelResourceLocation("builtin/missing", "missing");
}
@@ -34,6 +34,8 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import vazkii.botania.common.core.handler.IMCHandler;
import vazkii.botania.common.core.handler.ManaNetworkHandler;
import vazkii.botania.common.core.proxy.CommonProxy;
@@ -60,6 +62,8 @@ public class Botania {
@SidedProxy(serverSide = LibMisc.PROXY_COMMON, clientSide = LibMisc.PROXY_CLIENT)
public static CommonProxy proxy;
public static final Logger LOGGER = LogManager.getLogger(LibMisc.MOD_ID);
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
gardenOfGlassLoaded = Loader.isModLoaded("GardenOfGlass");
@@ -73,7 +77,7 @@ public class Botania {
quarkLoaded = Loader.isModLoaded("Quark");
storageDrawersLoaded = Loader.isModLoaded("StorageDrawers");
proxy.preInit(event);
MinecraftForge.EVENT_BUS.register(this);
}
@@ -4,8 +4,8 @@ import com.google.common.base.Throwables;
import net.minecraft.block.SoundType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.tileentity.MobSpawnerBaseLogic;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import vazkii.botania.common.Botania;
import vazkii.botania.common.lib.LibObfuscation;
import java.lang.invoke.MethodHandle;
@@ -89,7 +89,7 @@ public final class MethodHandles {
m.setAccessible(true);
isActivated = publicLookup().unreflect(m);
} catch (Throwable t) {
FMLLog.severe("[Botania]: Couldn't initialize methodhandles! Things will be broken!");
Botania.LOGGER.fatal("Couldn't initialize methodhandles! Things will be broken!");
t.printStackTrace();
throw Throwables.propagate(t);
}
@@ -28,7 +28,6 @@ import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
@@ -36,7 +35,6 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import org.apache.logging.log4j.Level;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.boss.IBotaniaBoss;
import vazkii.botania.api.lexicon.ITwoNamedPage;
@@ -169,7 +167,7 @@ public class CommonProxy {
if(page instanceof ITwoNamedPage)
words += countWords(((ITwoNamedPage) page).getSecondUnlocalizedName());
}
FMLLog.log(Level.INFO, "[Botania] The Lexica Botania has %d words.", words);
Botania.LOGGER.info("The Lexica Botania has %d words.", words);
registerDefaultEntityBlacklist();
}
@@ -21,13 +21,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.RecipeSorter;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import org.apache.logging.log4j.Level;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
@@ -2176,7 +2174,7 @@ public final class ModCraftingRecipes {
initGardenOfGlass();
int newRecipeListSize = CraftingManager.getInstance().getRecipeList().size();
FMLLog.log(Level.INFO, "[Botania] Registered %d recipes.", newRecipeListSize - recipeListSize);
Botania.LOGGER.info("Registered %d recipes.", newRecipeListSize - recipeListSize);
}
private static void initGardenOfGlass() {
@@ -11,14 +11,13 @@ package vazkii.botania.common.integration.corporea;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.items.wrapper.InvWrapper;
import org.apache.logging.log4j.Level;
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
import vazkii.botania.api.corporea.CorporeaRequest;
import vazkii.botania.api.corporea.ICorporeaSpark;
import vazkii.botania.api.corporea.IWrappedInventory;
import vazkii.botania.api.corporea.InvWithLocation;
import vazkii.botania.common.Botania;
import java.util.ArrayList;
import java.util.List;
@@ -129,7 +128,7 @@ public class WrappedDeepStorage extends WrappedInventoryBase {
deepStoragePresent = false;
}
checkedInterface = true;
FMLLog.log(Level.INFO, "[Botania] Corporea support for Deep Storage: %b", deepStoragePresent);
Botania.LOGGER.info("Corporea support for Deep Storage: %b", deepStoragePresent);
}
return deepStoragePresent;
}