Clean up Logging (#3953)

# Conflicts:
#	patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch
#	patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch
#	patches/minecraft/net/minecraft/entity/EntityList.java.patch
#	patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch
#	src/main/java/net/minecraftforge/oredict/OreDictionary.java
This commit is contained in:
diesieben07 authored and mezz committed 2017-06-22 23:18:49 -07:00
1 parent 68c6e7862e
commit 0e9820c51c
145 files changed
+806 -785

No files matched your search

@@ -373,7 +373,7 @@ public class BiomeDictionary
if (!hasAnyType(biome))
{
makeBestGuess(biome);
FMLLog.warning("No types have been added to Biome %s, types have been assigned on a best-effort guess: %s", biome.getRegistryName(), getTypes(biome));
FMLLog.log.warn("No types have been added to Biome {}, types have been assigned on a best-effort guess: {}", biome.getRegistryName(), getTypes(biome));
}
}
@@ -169,11 +169,11 @@ public class DimensionManager
int leakCount = leakedWorlds.count(System.identityHashCode(w));
if (leakCount == 5)
{
FMLLog.fine("The world %x (%s) may have leaked: first encounter (5 occurrences).\n", System.identityHashCode(w), w.getWorldInfo().getWorldName());
FMLLog.log.debug("The world {} ({}) may have leaked: first encounter (5 occurrences).\n", Integer.toHexString(System.identityHashCode(w)), w.getWorldInfo().getWorldName());
}
else if (leakCount % 5 == 0)
{
FMLLog.fine("The world %x (%s) may have leaked: seen %d times.\n", System.identityHashCode(w), w.getWorldInfo().getWorldName(), leakCount);
FMLLog.log.debug("The world {} ({}) may have leaked: seen {} times.\n", Integer.toHexString(System.identityHashCode(w)), w.getWorldInfo().getWorldName(), leakCount);
}
}
}
@@ -191,13 +191,13 @@ public class DimensionManager
worlds.put(id, world);
weakWorldMap.put(world, world);
server.worldTickTimes.put(id, new long[100]);
FMLLog.info("Loading dimension %d (%s) (%s)", id, world.getWorldInfo().getWorldName(), world.getMinecraftServer());
FMLLog.log.info("Loading dimension {} ({}) ({})", id, world.getWorldInfo().getWorldName(), world.getMinecraftServer());
}
else
{
worlds.remove(id);
server.worldTickTimes.remove(id);
FMLLog.info("Unloading dimension %d", id);
FMLLog.log.info("Unloading dimension {}", id);
}
ArrayList<WorldServer> tmp = new ArrayList<WorldServer>();
@@ -292,8 +292,8 @@ public class DimensionManager
}
catch (Exception e)
{
FMLCommonHandler.instance().getFMLLogger().log(Level.ERROR, String.format("An error occurred trying to create an instance of WorldProvider %d (%s)",
dim, getProviderType(dim)),e);
FMLLog.log.error("An error occurred trying to create an instance of WorldProvider {} ({})",
dim, getProviderType(dim), e);
throw new RuntimeException(e);
}
}
@@ -307,7 +307,7 @@ public class DimensionManager
{
if(!unloadQueue.contains(id))
{
FMLLog.fine("Queueing dimension %s to unload", id);
FMLLog.log.debug("Queueing dimension {} to unload", id);
unloadQueue.add(id);
}
else
@@ -339,7 +339,7 @@ public class DimensionManager
dimension.ticksWaited = 0;
if (w == null || !ForgeChunkManager.getPersistentChunksFor(w).isEmpty() || !w.playerEntities.isEmpty() || dimension.type.shouldLoadSpawn()) //Don't unload the world if the status changed
{
FMLLog.fine("Aborting unload for dimension %s as status changed", id);
FMLLog.log.debug("Aborting unload for dimension {} as status changed", id);
continue;
}
try
@@ -263,7 +263,7 @@ public class ForgeChunkManager
}
else
{
FMLLog.log(Level.ERROR, "Attempt to create a player ticket without a valid player");
FMLLog.log.error("Attempt to create a player ticket without a valid player");
throw new RuntimeException();
}
}
@@ -277,7 +277,7 @@ public class ForgeChunkManager
{
if (depth > getMaxChunkDepthFor(modId) || (depth <= 0 && getMaxChunkDepthFor(modId) > 0))
{
FMLLog.warning("The mod %s tried to modify the chunk ticket depth to: %d, its allowed maximum is: %d", modId, depth, getMaxChunkDepthFor(modId));
FMLLog.log.warn("The mod {} tried to modify the chunk ticket depth to: {}, its allowed maximum is: {}", modId, depth, getMaxChunkDepthFor(modId));
}
else
{
@@ -489,7 +489,7 @@ public class ForgeChunkManager
}
catch (IOException e)
{
FMLLog.log(Level.WARN, e, "Unable to read forced chunk data at %s - it will be ignored", chunkLoaderData.getAbsolutePath());
FMLLog.log.warn("Unable to read forced chunk data at {} - it will be ignored", chunkLoaderData.getAbsolutePath(), e);
return;
}
NBTTagList ticketList = forcedChunkData.getTagList("TicketList", Constants.NBT.TAG_COMPOUND);
@@ -501,13 +501,13 @@ public class ForgeChunkManager
if (!isPlayer && !Loader.isModLoaded(modId))
{
FMLLog.warning("Found chunkloading data for mod %s which is currently not available or active - it will be removed from the world save", modId);
FMLLog.log.warn("Found chunkloading data for mod {} which is currently not available or active - it will be removed from the world save", modId);
continue;
}
if (!isPlayer && !callbacks.containsKey(modId))
{
FMLLog.warning("The mod %s has registered persistent chunkloading data but doesn't seem to want to be called back with it - it will be removed from the world save", modId);
FMLLog.log.warn("The mod {} has registered persistent chunkloading data but doesn't seem to want to be called back with it - it will be removed from the world save", modId);
continue;
}
@@ -561,7 +561,7 @@ public class ForgeChunkManager
{
if (tick.ticketType == Type.ENTITY && tick.entity == null)
{
FMLLog.warning("Failed to load persistent chunkloading entity %s from store.", pendingEntities.inverse().get(tick));
FMLLog.log.warn("Failed to load persistent chunkloading entity {} from store.", pendingEntities.inverse().get(tick));
loadedTickets.remove(tick.modId, tick);
}
}
@@ -583,7 +583,7 @@ public class ForgeChunkManager
}
if (tickets.size() > maxTicketLength)
{
FMLLog.warning("The mod %s has too many open chunkloading tickets %d. Excess will be dropped", modId, tickets.size());
FMLLog.log.warn("The mod {} has too many open chunkloading tickets {}. Excess will be dropped", modId, tickets.size());
tickets.subList(maxTicketLength, tickets.size()).clear();
}
ForgeChunkManager.tickets.get(world).putAll(modId, tickets);
@@ -641,7 +641,7 @@ public class ForgeChunkManager
ModContainer container = getContainer(mod);
if (container == null)
{
FMLLog.warning("Unable to register a callback for an unknown mod %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod));
FMLLog.log.warn("Unable to register a callback for an unknown mod {} ({} : {})", mod, mod.getClass().getName(), Integer.toHexString(System.identityHashCode(mod)));
return;
}
@@ -699,12 +699,12 @@ public class ForgeChunkManager
ModContainer mc = getContainer(mod);
if (mc == null)
{
FMLLog.log(Level.ERROR, "Failed to locate the container for mod instance %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod));
FMLLog.log.error("Failed to locate the container for mod instance {} ({} : {})", mod, mod.getClass().getName(), Integer.toHexString(System.identityHashCode(mod)));
return null;
}
if (playerTickets.get(player).size()>playerTicketLength)
{
FMLLog.warning("Unable to assign further chunkloading tickets to player %s (on behalf of mod %s)", player, mc.getModId());
FMLLog.log.warn("Unable to assign further chunkloading tickets to player {} (on behalf of mod {})", player, mc.getModId());
return null;
}
Ticket ticket = new Ticket(mc.getModId(),type,world,player);
@@ -726,13 +726,13 @@ public class ForgeChunkManager
ModContainer container = getContainer(mod);
if (container == null)
{
FMLLog.log(Level.ERROR, "Failed to locate the container for mod instance %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod));
FMLLog.log.error("Failed to locate the container for mod instance {} ({} : {})", mod, mod.getClass().getName(), Integer.toHexString(System.identityHashCode(mod)));
return null;
}
String modId = container.getModId();
if (!callbacks.containsKey(modId))
{
FMLLog.severe("The mod %s has attempted to request a ticket without a listener in place", modId);
FMLLog.log.fatal("The mod {} has attempted to request a ticket without a listener in place", modId);
throw new RuntimeException("Invalid ticket request");
}
@@ -742,7 +742,7 @@ public class ForgeChunkManager
{
if (!warnedMods.contains(modId))
{
FMLLog.info("The mod %s has attempted to allocate a chunkloading ticket beyond it's currently allocated maximum : %d", modId, allowedCount);
FMLLog.log.info("The mod {} has attempted to allocate a chunkloading ticket beyond it's currently allocated maximum: {}", modId, allowedCount);
warnedMods.add(modId);
}
return null;
@@ -806,7 +806,7 @@ public class ForgeChunkManager
}
if (ticket.isPlayerTicket() ? !playerTickets.containsValue(ticket) : !tickets.get(ticket.world).containsEntry(ticket.modId, ticket))
{
FMLLog.severe("The mod %s attempted to force load a chunk with an invalid ticket. This is not permitted.", ticket.modId);
FMLLog.log.fatal("The mod {} attempted to force load a chunk with an invalid ticket. This is not permitted.", ticket.modId);
return;
}
ticket.requestedChunks.add(chunk);
@@ -949,7 +949,7 @@ public class ForgeChunkManager
}
catch (IOException e)
{
FMLLog.log(Level.WARN, e, "Unable to write forced chunk data to %s - chunkloading won't work", chunkLoaderData.getAbsolutePath());
FMLLog.log.warn("Unable to write forced chunk data to {} - chunkloading won't work", chunkLoaderData.getAbsolutePath(), e);
return;
}
}
@@ -1015,7 +1015,7 @@ public class ForgeChunkManager
dest.delete();
}
cfgFile.renameTo(dest);
FMLLog.log(Level.ERROR, e, "A critical error occurred reading the forgeChunkLoading.cfg file, defaults will be used - the invalid file is backed up at forgeChunkLoading.cfg.bak");
FMLLog.log.error("A critical error occurred reading the forgeChunkLoading.cfg file, defaults will be used - the invalid file is backed up at forgeChunkLoading.cfg.bak", e);
}
syncConfigDefaults();
}
@@ -1068,7 +1068,7 @@ public class ForgeChunkManager
temp.setMinValue(0);
dormantChunkCacheSize = temp.getInt(0);
propOrder.add("dormantChunkCacheSize");
FMLLog.info("Configured a dormant chunk cache size of %d", temp.getInt(0));
FMLLog.log.info("Configured a dormant chunk cache size of {}", temp.getInt(0));
config.setCategoryPropertyOrder("defaults", propOrder);
@@ -42,6 +42,8 @@ import java.util.List;
import java.util.Map;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraft.crash.ICrashReportDetail;
import net.minecraft.item.crafting.Ingredient;
@@ -120,6 +122,8 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
public static int dimensionUnloadQueueDelay = 0;
public static boolean logCascadingWorldGeneration = true; // see Chunk#logCascadingWorldGeneration()
static final Logger log = LogManager.getLogger(ForgeVersion.MOD_ID);
private static Configuration config;
private static ForgeModContainer INSTANCE;
public static ForgeModContainer getInstance()
@@ -233,7 +237,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
if (removeErroringEntities)
{
FMLLog.warning("Enabling removal of erroring Entities - USE AT YOUR OWN RISK");
FMLLog.log.warn("Enabling removal of erroring Entities - USE AT YOUR OWN RISK");
}
prop = config.get(Configuration.CATEGORY_GENERAL, "removeErroringTileEntities", false);
@@ -244,7 +248,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
if (removeErroringTileEntities)
{
FMLLog.warning("Enabling removal of erroring Tile Entities - USE AT YOUR OWN RISK");
FMLLog.log.warn("Enabling removal of erroring Tile Entities - USE AT YOUR OWN RISK");
}
prop = config.get(Configuration.CATEGORY_GENERAL, "fullBoundingBoxLadders", false);
@@ -420,11 +424,11 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
itr.remove();
}
FMLLog.log(ForgeVersion.MOD_ID, Level.DEBUG, "Preloading CrashReport Classes");
log.debug("Preloading CrashReport Classes");
Collections.sort(all); //Sort it because I like pretty output ;)
for (String name : all)
{
FMLLog.log(ForgeVersion.MOD_ID, Level.DEBUG, "\t" + name);
log.debug("\t{}", name);
try
{
Class.forName(name.replace('/', '.'), false, MinecraftForge.class.getClassLoader());
@@ -37,6 +37,8 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.google.common.io.ByteStreams;
import com.google.gson.Gson;
@@ -70,6 +72,8 @@ public class ForgeVersion
@SuppressWarnings("unused")
private static String target = null;
private static final Logger log = LogManager.getLogger("ForgeVersionCheck");
public static int getMajorVersion()
{
return majorVersion;
@@ -186,7 +190,7 @@ public class ForgeVersion
{
if (!ForgeModContainer.getConfig().get(ForgeModContainer.VERSION_CHECK_CAT, "Global", true).getBoolean())
{
FMLLog.log("ForgeVersionCheck", Level.INFO, "Global Forge version check system disabled, no further processing.");
log.info("Global Forge version check system disabled, no further processing.");
return;
}
@@ -199,7 +203,7 @@ public class ForgeVersion
}
else
{
FMLLog.log("ForgeVersionCheck", Level.INFO, "[%s] Skipped version check", mod.getModId());
log.info("[{}] Skipped version check", mod.getModId());
}
}
}
@@ -208,7 +212,7 @@ public class ForgeVersion
{
try
{
FMLLog.log("ForgeVersionCheck", Level.INFO, "[%s] Starting version check at %s", mod.getModId(), url.toString());
log.info("[{}] Starting version check at {}", mod.getModId(), url.toString());
Status status = PENDING;
ComparableVersion target = null;
@@ -216,7 +220,7 @@ public class ForgeVersion
String data = new String(ByteStreams.toByteArray(con), "UTF-8");
con.close();
FMLLog.log("ForgeVersionCheck", Level.DEBUG, "[%s] Received version check data:\n%s", mod.getModId(), data);
log.debug("[{}] Received version check data:\n{}", mod.getModId(), data);
@SuppressWarnings("unchecked")
@@ -269,7 +273,7 @@ public class ForgeVersion
else
status = BETA;
FMLLog.log("ForgeVersionCheck", Level.INFO, "[%s] Found status: %s Target: %s", mod.getModId(), status, target);
log.info("[{}] Found status: {} Target: {}", mod.getModId(), status, target);
Map<ComparableVersion, String> changes = new LinkedHashMap<ComparableVersion, String>();
@SuppressWarnings("unchecked")
@@ -298,7 +302,7 @@ public class ForgeVersion
}
catch (Exception e)
{
FMLLog.log("ForgeVersionCheck", Level.DEBUG, e, "Failed to process update information");
log.debug("Failed to process update information", e);
status = FAILED;
}
}
@@ -83,7 +83,7 @@ public class MinecraftForge
*/
public static void initialize()
{
FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion());
FMLLog.log.info("MinecraftForge v{} Initialized", ForgeVersion.getVersion());
OreDictionary.getOreName(0);
@@ -113,11 +113,11 @@ public class MinecraftForge
if (all.size() == 0)
return;
FMLLog.log(modID, Level.DEBUG, "Preloading CrashReport Classes");
ForgeModContainer.log.debug("Preloading CrashReport Classes");
Collections.sort(all); //Sort it because I like pretty output ;)
for (String name : all)
{
FMLLog.log(modID, Level.DEBUG, "\t" + name);
ForgeModContainer.log.debug("\t{}", name);
try
{
Class.forName(name.replace('/', '.'), false, MinecraftForge.class.getClassLoader());
@@ -95,7 +95,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
}
catch (IOException e)
{
FMLLog.log(Level.ERROR, e, "A critical error occurred copying %s to world specific dat folder - new file will be created.", parentFile.getName());
FMLLog.log.error("A critical error occurred copying {} to world specific dat folder - new file will be created.", parentFile.getName(), e);
}
}
}
@@ -115,7 +115,7 @@ public enum CapabilityManager
Type type = (Type)entry.getAnnotationInfo().get("value");
if (type == null)
{
FMLLog.log(Level.WARN, "Unable to inject capability at %s.%s (Invalid Annotation)", targetClass, targetName);
FMLLog.log.warn("Unable to inject capability at {}.{} (Invalid Annotation)", targetClass, targetName);
continue;
}
final String capabilityName = type.getInternalName().replace('/', '.').intern();
@@ -142,7 +142,7 @@ public enum CapabilityManager
{
if ((mtd.getModifiers() & Modifier.STATIC) != Modifier.STATIC)
{
FMLLog.log(Level.WARN, "Unable to inject capability %s at %s.%s (Non-Static)", capabilityName, targetClass, targetName);
FMLLog.log.warn("Unable to inject capability {} at {}.{} (Non-Static)", capabilityName, targetClass, targetName);
return null;
}
@@ -151,11 +151,11 @@ public enum CapabilityManager
return null;
}
}
FMLLog.log(Level.WARN, "Unable to inject capability %s at %s.%s (Method Not Found)", capabilityName, targetClass, targetName);
FMLLog.log.warn("Unable to inject capability {} at {}.{} (Method Not Found)", capabilityName, targetClass, targetName);
}
catch (Exception e)
{
FMLLog.log(Level.WARN, e, "Unable to inject capability %s at %s.%s", capabilityName, targetClass, targetName);
FMLLog.log.warn("Unable to inject capability {} at {}.{}", capabilityName, targetClass, targetName, e);
}
return null;
}
@@ -173,14 +173,14 @@ public enum CapabilityManager
Field field = Class.forName(targetClass).getDeclaredField(targetName);
if ((field.getModifiers() & Modifier.STATIC) != Modifier.STATIC)
{
FMLLog.log(Level.WARN, "Unable to inject capability %s at %s.%s (Non-Static)", capabilityName, targetClass, targetName);
FMLLog.log.warn("Unable to inject capability {} at {}.{} (Non-Static)", capabilityName, targetClass, targetName);
return null;
}
EnumHelper.setFailsafeFieldValue(field, null, input);
}
catch (Exception e)
{
FMLLog.log(Level.WARN, e, "Unable to inject capability %s at %s.%s", capabilityName, targetClass, targetName);
FMLLog.log.warn("Unable to inject capability {} at {}.{}", capabilityName, targetClass, targetName, e);
}
return null;
}
@@ -120,7 +120,7 @@ public class ChunkIOExecutor
ChunkIOProvider task = tasks.get(key);
if (task == null)
{
FMLLog.warning("Attempted to dequeue chunk that wasn't queued? %d @ (%d, %d)", world.provider.getDimension(), x, z);
FMLLog.log.warn("Attempted to dequeue chunk that wasn't queued? {} @ ({}, {})", world.provider.getDimension(), x, z);
return;
}
@@ -104,7 +104,7 @@ public class ConfigManager
public static void loadData(ASMDataTable data)
{
FMLLog.fine("Loading @Config anotation data");
FMLLog.log.debug("Loading @Config anotation data");
for (ASMData target : data.getAll(Config.class.getName()))
{
String modid = (String)target.getAnnotationInfo().get("modid");
@@ -150,7 +150,7 @@ public class ConfigManager
*/
public static void sync(String modid, Config.Type type)
{
FMLLog.fine("Attempting to inject @Config classes into %s for type %s", modid, type);
FMLLog.log.debug("Attempting to inject @Config classes into {} for type {}", modid, type);
ClassLoader mcl = Loader.instance().getModClassLoader();
File configDir = Loader.instance().getConfigDir();
Multimap<Config.Type, ASMData> map = asm_data.get(modid);
@@ -194,7 +194,7 @@ public class ConfigManager
}
catch (Exception e)
{
FMLLog.log(Level.ERROR, e, "An error occurred trying to load a config for %s into %s", modid, targ.getClassName());
FMLLog.log.error("An error occurred trying to load a config for {} into {}", targ.getClassName(), e);
throw new LoaderException(e);
}
}
@@ -136,7 +136,7 @@ public class Configuration
{
File fileBak = new File(file.getAbsolutePath() + "_" +
new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ".errored");
FMLLog.severe("An exception occurred while loading config file %s. This file will be renamed to %s " +
FMLLog.log.fatal("An exception occurred while loading config file {}. This file will be renamed to {} " +
"and a new config file will be generated.", file.getName(), fileBak.getName());
e.printStackTrace();
@@ -241,12 +241,12 @@ public final class AnimationStateMachine implements IAnimationStateMachine
}
catch(IOException e)
{
FMLLog.log(Level.ERROR, e, "Exception loading Animation State Machine %s, skipping", location);
FMLLog.log.error("Exception loading Animation State Machine {}, skipping", location, e);
return missing;
}
catch(JsonParseException e)
{
FMLLog.log(Level.ERROR, e, "Exception loading Animation State Machine %s, skipping", location);
FMLLog.log.error("Exception loading Animation State Machine {}, skipping", location, e);
return missing;
}
finally
@@ -100,7 +100,7 @@ public final class Clips
{
return new ModelClip(clip.get(), modelLocation, clipName);
}
FMLLog.getLogger().error("Unable to find clip " + clipName + " in the model " + modelLocation);
FMLLog.log.error("Unable to find clip {} in the model {}", clipName, modelLocation);
}
// FIXME: missing clip?
return new ModelClip(IdentityClip.INSTANCE, modelLocation, clipName);
@@ -39,7 +39,7 @@ public class DimensionMessageHandler extends SimpleChannelInboundHandler<ForgeMe
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
{
FMLLog.log(Level.ERROR, cause, "DimensionMessageHandler exception");
FMLLog.log.error("DimensionMessageHandler exception", cause);
super.exceptionCaught(ctx, cause);
}
@@ -36,7 +36,7 @@ public class FluidIdRegistryMessageHandler extends SimpleChannelInboundHandler<F
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
{
FMLLog.log(Level.ERROR, cause, "FluidIdRegistryMessageHandler exception");
FMLLog.log.error("FluidIdRegistryMessageHandler exception", cause);
super.exceptionCaught(ctx, cause);
}
@@ -110,7 +110,7 @@ public abstract class ForgeMessage {
}
else
{
FMLLog.getLogger().log(Level.INFO, "Legacy server message contains no default fluid list - there may be problems with fluids");
FMLLog.log.info("Legacy server message contains no default fluid list - there may be problems with fluids");
defaultFluids.clear();
}
}
@@ -310,7 +310,7 @@ public class EnumHelper
}
for (String line : lines)
FMLLog.severe(line);
FMLLog.log.fatal(line);
if (test)
{