-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
// Put your project-specific buildscript code in this file | ||
jar { | ||
manifest { | ||
attributes ( | ||
'FMLCorePlugin': 'io.github.legacymoddingmc.notenoughverbosity.NotEnoughVerbosity' | ||
) | ||
} | ||
} | ||
|
||
archivesBaseName = "+++" + archivesBaseName |
60 changes: 60 additions & 0 deletions
60
src/main/java/io/github/legacymoddingmc/notenoughverbosity/NotEnoughVerbosity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package io.github.legacymoddingmc.notenoughverbosity; | ||
|
||
import java.util.Map; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.apache.logging.log4j.core.config.ConfigurationFactory; | ||
|
||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin; | ||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; | ||
|
||
@MCVersion("1.7.10") | ||
public class NotEnoughVerbosity implements IFMLLoadingPlugin { | ||
|
||
public static final Logger LOGGER = LogManager.getLogger("notenoughverbosity"); | ||
|
||
public NotEnoughVerbosity() { | ||
reconfigureLog4j(); | ||
} | ||
|
||
public static void reconfigureLog4j() { | ||
org.apache.logging.log4j.spi.LoggerContext ctx = LogManager.getFactory().getContext(LogManager.class.getName(), net.minecraft.launchwrapper.Launch.classLoader.getClass().getClassLoader(), false); | ||
if(System.getProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY) != null) { | ||
if(ctx instanceof org.apache.logging.log4j.core.LoggerContext) { | ||
System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY); | ||
((org.apache.logging.log4j.core.LoggerContext)ctx).reconfigure(); | ||
LOGGER.info("Logger reconfigured."); | ||
} else { | ||
LOGGER.warn("Logger context is of unknown type " + ctx.getClass() + ", unable to reconfigure."); | ||
} | ||
} else { | ||
LOGGER.info("Logger config system property is not set, not doing anything."); | ||
} | ||
} | ||
|
||
@Override | ||
public String[] getASMTransformerClass() { | ||
return new String[0]; | ||
} | ||
|
||
@Override | ||
public String getModContainerClass() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getSetupClass() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void injectData(Map<String, Object> data) { | ||
|
||
} | ||
|
||
@Override | ||
public String getAccessTransformerClass() { | ||
return null; | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
src/main/java/io/github/legacymoddingmc/notenoughverbosity/Notenoughverbosity.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters