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

@@ -222,7 +222,7 @@ public class FMLClientHandler implements IFMLSidedHandler
this.resourcePackMap = Maps.newHashMap();
if (minecraft.isDemo())
{
FMLLog.severe("DEMO MODE DETECTED, FML will not work. Finishing now.");
FMLLog.log.fatal("DEMO MODE DETECTED, FML will not work. Finishing now.");
haltGame("FML will not run in demo mode", new RuntimeException());
return;
}
@@ -254,7 +254,7 @@ public class FMLClientHandler implements IFMLSidedHandler
}
catch (CustomModLoadingErrorDisplayException custom)
{
FMLLog.log(Level.ERROR, custom, "A custom exception was thrown by a mod, the game will now halt");
FMLLog.log.error("A custom exception was thrown by a mod, the game will now halt", custom);
customError = custom;
}
catch (MultipleModsErrored multiple)
@@ -277,7 +277,7 @@ public class FMLClientHandler implements IFMLSidedHandler
}
catch (CustomModLoadingErrorDisplayException custom)
{
FMLLog.log(Level.ERROR, custom, "A custom exception was thrown by a mod, the game will now halt");
FMLLog.log.error("A custom exception was thrown by a mod, the game will now halt", custom);
customError = custom;
}
catch (LoaderException le)
@@ -314,7 +314,7 @@ public class FMLClientHandler implements IFMLSidedHandler
{
ModMetadata optifineMetadata = MetadataCollection.from(optifineModInfoInputStream, "optifine").getMetadataForId("optifine", dummyOptifineMeta);
optifineContainer = new DummyModContainer(optifineMetadata);
FMLLog.info("Forge Mod Loader has detected optifine %s, enabling compatibility features", optifineContainer.getVersion());
FMLLog.log.info("Forge Mod Loader has detected optifine {}, enabling compatibility features", optifineContainer.getVersion());
}
finally
{
@@ -359,7 +359,7 @@ public class FMLClientHandler implements IFMLSidedHandler
}
catch (CustomModLoadingErrorDisplayException custom)
{
FMLLog.log(Level.ERROR, custom, "A custom exception was thrown by a mod, the game will now halt");
FMLLog.log.error("A custom exception was thrown by a mod, the game will now halt", custom);
customError = custom;
SplashProgress.finish();
return;
@@ -394,7 +394,7 @@ public class FMLClientHandler implements IFMLSidedHandler
guiFactories.put(mc, guiFactory);
} catch (Exception e)
{
FMLLog.log(Level.ERROR, e, "A critical error occurred instantiating the gui factory for mod %s", mc.getModId());
FMLLog.log.error("A critical error occurred instantiating the gui factory for mod {}", mc.getModId(), e);
}
}
loading = false;
@@ -684,12 +684,12 @@ public class FMLClientHandler implements IFMLSidedHandler
}
catch (NoSuchMethodException e)
{
FMLLog.log(Level.ERROR, "The container %s (type %s) returned an invalid class for it's resource pack.", container.getName(), container.getClass().getName());
FMLLog.log.error("The container {} (type {}) returned an invalid class for it's resource pack.", container.getName(), container.getClass().getName());
return;
}
catch (Exception e)
{
FMLLog.log(Level.ERROR, e, "An unexpected exception occurred constructing the custom resource pack for %s", container.getName());
FMLLog.log.error("An unexpected exception occurred constructing the custom resource pack for {}", container.getName(), e);
throw Throwables.propagate(e);
}
}
@@ -763,7 +763,7 @@ public class FMLClientHandler implements IFMLSidedHandler
}
catch (Exception e1)
{
FMLLog.warning("There appears to be a problem loading the save %s, both level files are unreadable.", comparator.getFileName());
FMLLog.log.warn("There appears to be a problem loading the save {}, both level files are unreadable.", comparator.getFileName());
return;
}
}
@@ -25,6 +25,7 @@ import java.io.IOException;
import java.io.InputStream;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import javax.imageio.ImageIO;
@@ -61,7 +62,7 @@ public class FMLFileResourcePack extends FileResourcePack implements FMLContaine
{
if ("pack.mcmeta".equals(resourceName))
{
FMLLog.log(container.getName(), Level.DEBUG, "Mod %s is missing a pack.mcmeta file, substituting a dummy one", container.getName());
LogManager.getLogger(container.getName()).debug("Mod {} is missing a pack.mcmeta file, substituting a dummy one", container.getName());
return new ByteArrayInputStream(("{\n" +
" \"pack\": {\n"+
" \"description\": \"dummy FML pack for "+container.getName()+"\",\n"+
@@ -25,6 +25,7 @@ import java.io.IOException;
import java.io.InputStream;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import javax.imageio.ImageIO;
@@ -66,7 +67,7 @@ public class FMLFolderResourcePack extends FolderResourcePack implements FMLCont
{
if ("pack.mcmeta".equals(resourceName))
{
FMLLog.log(container.getName(), Level.DEBUG, "Mod %s is missing a pack.mcmeta file, substituting a dummy one", container.getName());
LogManager.getLogger(container.getName()).debug("Mod {} is missing a pack.mcmeta file, substituting a dummy one", container.getName());
return new ByteArrayInputStream(("{\n" +
" \"pack\": {\n"+
" \"description\": \"dummy FML pack for "+container.getName()+"\",\n"+
@@ -65,7 +65,7 @@ public class GuiErrorBase extends GuiErrorScreen
}
catch (Exception e)
{
FMLLog.log(Level.ERROR, e, "Problem opening mods folder");
FMLLog.log.error("Problem opening mods folder", e);
}
}
else if (button.id == 11)
@@ -76,7 +76,7 @@ public class GuiErrorBase extends GuiErrorScreen
}
catch (Exception e)
{
FMLLog.log(Level.ERROR, e, "Problem opening log file " + clientLog);
FMLLog.log.error("Problem opening log file {}", clientLog, e);
}
}
}
@@ -71,7 +71,7 @@ public class GuiJava8Error extends GuiErrorBase
}
catch (Exception e)
{
FMLLog.log(Level.ERROR, e, "Problem launching browser");
FMLLog.log.error("Problem launching browser", e);
}
}
else
@@ -295,7 +295,7 @@ public class GuiModList extends GuiScreen
}
catch (Exception e)
{
FMLLog.log(Level.ERROR, e, "There was a critical issue trying to build the config GUI for %s", selectedMod.getModId());
FMLLog.log.error("There was a critical issue trying to build the config GUI for {}", selectedMod.getModId(), e);
}
return;
}
@@ -78,7 +78,7 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo implements GuiYesNoCallback
}
else
{
FMLLog.info("Capturing current state of world %s into file %s", saveName, zip.getAbsolutePath());
FMLLog.log.info("Capturing current state of world {} into file {}", saveName, zip.getAbsolutePath());
try
{
String skip = System.getProperty("fml.doNotBackup");
@@ -89,11 +89,11 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo implements GuiYesNoCallback
else
{
for (int x = 0; x < 10; x++)
FMLLog.severe("!!!!!!!!!! UPDATING WORLD WITHOUT DOING BACKUP !!!!!!!!!!!!!!!!");
FMLLog.log.fatal("!!!!!!!!!! UPDATING WORLD WITHOUT DOING BACKUP !!!!!!!!!!!!!!!!");
}
} catch (IOException e)
{
FMLLog.log(Level.WARN, e, "There was a problem saving the backup %s. Please fix and try again", zip.getName());
FMLLog.log.warn("There was a problem saving the backup {}. Please fix and try again", zip.getName(), e);
FMLClientHandler.instance().showGuiScreen(new GuiBackupFailed(parent, zip));
return;
}
@@ -160,7 +160,7 @@ public class SplashProgress
}
catch(IOException e)
{
FMLLog.info("Could not load splash.properties, will create a default one");
FMLLog.log.info("Could not load splash.properties, will create a default one");
}
finally
{
@@ -202,7 +202,7 @@ public class SplashProgress
}
catch(IOException e)
{
FMLLog.log(Level.ERROR, e, "Could not save the splash.properties file");
FMLLog.log.error("Could not save the splash.properties file", e);
}
finally
{
@@ -233,7 +233,7 @@ public class SplashProgress
CrashReport report = CrashReport.makeCrashReport(new Throwable(), "Loading screen debug info");
StringBuilder systemDetailsBuilder = new StringBuilder();
report.getCategory().appendToStringBuilder(systemDetailsBuilder);
FMLLog.info(systemDetailsBuilder.toString());
FMLLog.log.info(systemDetailsBuilder.toString());
try
{
@@ -401,13 +401,13 @@ public class SplashProgress
if (!isDisplayVSyncForced)
{
isDisplayVSyncForced = true;
FMLLog.log(Level.INFO, "Using alternative sync timing : %d frames of Display.update took %d nanos", TIMING_FRAME_COUNT, updateTiming);
FMLLog.log.info("Using alternative sync timing : {} frames of Display.update took {} nanos", TIMING_FRAME_COUNT, updateTiming);
}
try { Thread.sleep(16); } catch (InterruptedException ie) {}
} else
{
if (framecount ==TIMING_FRAME_COUNT) {
FMLLog.log(Level.INFO, "Using sync timing. %d frames of Display.update took %d nanos", TIMING_FRAME_COUNT, updateTiming);
FMLLog.log.info("Using sync timing. {} frames of Display.update took {} nanos", TIMING_FRAME_COUNT, updateTiming);
}
Display.sync(100);
}
@@ -581,7 +581,7 @@ public class SplashProgress
@Override
public void uncaughtException(Thread t, Throwable e)
{
FMLLog.log(Level.ERROR, e, "Splash thread Exception");
FMLLog.log.error("Splash thread Exception", e);
threadError = e;
}
});
@@ -730,7 +730,7 @@ public class SplashProgress
}
catch(IOException e)
{
FMLLog.log(Level.ERROR, e, "Could not save the splash.properties file");
FMLLog.log.error("Could not save the splash.properties file", e);
return false;
}
finally
@@ -128,7 +128,7 @@ public class GuiConfigEntries extends GuiListExtended
}
catch (Throwable e)
{
FMLLog.severe("There was a critical error instantiating the custom IConfigEntry for config element %s.", configElement.getName());
FMLLog.log.fatal("There was a critical error instantiating the custom IConfigEntry for config element {}.", configElement.getName());
e.printStackTrace();
}
else if (configElement.isProperty())
@@ -81,7 +81,7 @@ public class GuiEditArrayEntries extends GuiListExtended
}
catch (Throwable e)
{
FMLLog.log(Level.ERROR, e, "There was a critical error instantiating the custom IGuiEditListEntry for property %s.", configElement.getName());
FMLLog.log.error("There was a critical error instantiating the custom IGuiEditListEntry for property {}.", configElement.getName(), e);
}
}
}
@@ -156,7 +156,7 @@ public class GuiEditArrayEntries extends GuiListExtended
}
catch (Throwable e)
{
FMLLog.log(Level.ERROR, e, "There was a critical error instantiating the custom IGuiEditListEntry for property %s.", configElement.getName());
FMLLog.log.error("There was a critical error instantiating the custom IGuiEditListEntry for property {}.", configElement.getName(), e);
}
}
else if (configElement.isList() && configElement.getType() == ConfigGuiType.BOOLEAN)