diff options
author | botn365 <42187820+botn365@users.noreply.github.com> | 2019-12-30 03:55:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-30 03:55:42 +0100 |
commit | fa1a1f4a6cd8dee8011a8f04fa6afbcc71d8db89 (patch) | |
tree | b9f75736d90eb228de26ad8dcf9956bd1e6bd7e8 /src/Java/gtPlusPlus/api/objects/Logger.java | |
parent | a731e939c6b9a70ac9fd444dbf06243f63f29c06 (diff) | |
parent | d2ab710218628d51cd2ede566d50492238d797cf (diff) | |
download | GT5-Unofficial-fa1a1f4a6cd8dee8011a8f04fa6afbcc71d8db89.tar.gz GT5-Unofficial-fa1a1f4a6cd8dee8011a8f04fa6afbcc71d8db89.tar.bz2 GT5-Unofficial-fa1a1f4a6cd8dee8011a8f04fa6afbcc71d8db89.zip |
Merge pull request #5 from alkcorp/master
sync fork
Diffstat (limited to 'src/Java/gtPlusPlus/api/objects/Logger.java')
-rw-r--r-- | src/Java/gtPlusPlus/api/objects/Logger.java | 156 |
1 files changed, 97 insertions, 59 deletions
diff --git a/src/Java/gtPlusPlus/api/objects/Logger.java b/src/Java/gtPlusPlus/api/objects/Logger.java index f994c40b52..9c1e3d4338 100644 --- a/src/Java/gtPlusPlus/api/objects/Logger.java +++ b/src/Java/gtPlusPlus/api/objects/Logger.java @@ -6,11 +6,12 @@ import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.relauncher.FMLRelaunchLog; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.proxy.ClientProxy; +import gtPlusPlus.preloader.asm.AsmConfig; public class Logger { - + public Logger(String string) { - + } // Logging Functions @@ -22,133 +23,170 @@ public class Logger { return gtPlusPlusLogger; } + private static final boolean enabled = !AsmConfig.disableAllLogging; + public static final org.apache.logging.log4j.Logger getLogger(){ return modLogger; } // Non-Dev Comments public static void INFO(final String s) { - modLogger.info(s); + if (enabled) { + modLogger.info(s); + } } // Non-Dev Comments public static void MACHINE_INFO(final String s) { - - boolean localPlayer = false; - try { - if (ClientProxy.playerName != null){ - if (ClientProxy.playerName.toLowerCase().contains("draknyte1")){ - localPlayer = true; + if (enabled) { + + boolean localPlayer = false; + try { + if (ClientProxy.playerName != null){ + if (ClientProxy.playerName.toLowerCase().contains("draknyte1")){ + localPlayer = true; + } } } - } - catch (final Throwable t){ - - } - - if (CORE.ConfigSwitches.MACHINE_INFO || localPlayer) { - final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2); - modLogger.info("Machine Info: " + s + " | " + name1); + catch (final Throwable t){ + + } + + if (CORE.ConfigSwitches.MACHINE_INFO || localPlayer) { + final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2); + modLogger.info("Machine Info: " + s + " | " + name1); + } } } // Developer Comments public static void WARNING(final String s) { - if (CORE.DEBUG) { - modLogger.warn(s); + if (enabled) { + if (CORE.DEBUG) { + modLogger.warn(s); + } } } // Errors public static void ERROR(final String s) { - if (CORE.DEBUG) { - modLogger.fatal(s); + if (enabled) { + if (CORE.DEBUG) { + modLogger.fatal(s); + } } } // Developer Logger public static void SPECIFIC_WARNING(final String whatToLog, final String msg, final int line) { - // if (!CORE.DEBUG){ - FMLLog.warning("GT++ |" + line + "| " + whatToLog + " | " + msg); - // } + if (enabled) { + // if (!CORE.DEBUG){ + FMLLog.warning("GT++ |" + line + "| " + whatToLog + " | " + msg); + // } + } } // ASM Comments public static void LOG_ASM(final String s) { - FMLRelaunchLog.info("[Special ASM Logging] ", s); - } - - - - - - - - - - + if (enabled) { + FMLRelaunchLog.info("[Special ASM Logging] ", s); + } + } + + + + + + + + + + /** * Special Loggers */ - + /** * Special Logger for Bee related content */ public static void BEES(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[Bees] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[Bees] "+s); + } + } } /** * Special Logger for Debugging Bee related content */ public static void DEBUG_BEES(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[Debug][Bees] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[Debug][Bees] "+s); + } + } } - - - + + + /** * Special Logger for Materials related content */ public static void MATERIALS(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[Materials] "+s); + if (enabled) { + if (/* CORE.DEVENV || */CORE.DEBUG) { + modLogger.info("[Materials] "+s); + } + } } /** * Special Logger for Debugging Materials related content */ public static void DEBUG_MATERIALS(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[Debug][Materials] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[Debug][Materials] "+s); + } + } } - + /** * Special Logger for Reflection related content */ public static void REFLECTION(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[Reflection] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[Reflection] "+s); + } + } } - + /** * Special Logger for Darkworld related content */ public static void WORLD(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[WorldGen] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[WorldGen] "+s); + } + } } public static void RECIPE(String string) { - if (/*CORE.DEVENV || */CORE.DEBUG) - modLogger.info("[Recipe] "+string); + if (enabled) { + if (/*CORE.DEVENV || */CORE.DEBUG) { + modLogger.info("[Recipe] "+string); + } + } } public static void SPACE(final String s) { - modLogger.info("[Space] "+s); + if (enabled) { + modLogger.info("[Space] "+s); + } } - - + + } |