-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Now everything is logged as soon as the server starts, no more holding logs until bukkit initialization. * Now loggers follow the forge style of logging, this also applies to plugins * Added crucible option to show who is logging to System.out, now you can catch that annoying mod/plugin spamming nonsense in the console. * Added log4j context values for System.out calls, you can use %X{crucible-className} %X{crucible-methodName} and %X{crucible-lineNumber} on custom formatted logs for more precise information on what is directly printing to your logs * Added plugin prefix to colored console sender messages when logStdOutCaller is enabled This change can cause breaking issues to logging related things. More testing may be required.
- Loading branch information
1 parent
654d44b
commit 5dd5521
Showing
11 changed files
with
277 additions
and
23 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
patches/cpw/mods/fml/common/launcher/FMLServerTweaker.java.patch
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,10 @@ | ||
--- ../src-base/minecraft/cpw/mods/fml/common/launcher/FMLServerTweaker.java | ||
+++ ../src-work/minecraft/cpw/mods/fml/common/launcher/FMLServerTweaker.java | ||
@@ -19,6 +19,7 @@ | ||
classLoader.addTransformerExclusion("cpw.mods.fml.repackage."); | ||
classLoader.addTransformerExclusion("cpw.mods.fml.relauncher."); | ||
classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers."); | ||
+ classLoader.addTransformerExclusion("io.github.crucible.bootstrap."); // Crucible - make our bootstrap stuff visible for both obfuscated and not obfuscated sides | ||
classLoader.addClassLoaderExclusion("LZMA."); | ||
FMLLaunchHandler.configureForServerLaunch(classLoader, this); | ||
FMLLaunchHandler.appendCoreMods(); |
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,26 @@ | ||
--- ../src-base/minecraft/cpw/mods/fml/relauncher/FMLRelaunchLog.java | ||
+++ ../src-work/minecraft/cpw/mods/fml/relauncher/FMLRelaunchLog.java | ||
@@ -21,6 +21,7 @@ | ||
import org.apache.logging.log4j.ThreadContext; | ||
|
||
import cpw.mods.fml.common.TracingPrintStream; | ||
+import org.apache.logging.log4j.spi.LoggerContext; | ||
|
||
public class FMLRelaunchLog { | ||
|
||
@@ -34,6 +35,7 @@ | ||
private static boolean configured; | ||
|
||
private Logger myLog; | ||
+ public LoggerContext ctx; // Crucible - Used to go nuclear down the line when merging bukkit and forge loggers | ||
|
||
static Side side; | ||
|
||
@@ -47,6 +49,7 @@ | ||
private static void configureLogging() | ||
{ | ||
log.myLog = LogManager.getLogger("FML"); | ||
+ log.ctx = LogManager.getContext(false); // Crucible - capture the context | ||
ThreadContext.put("side", side.name().toLowerCase(Locale.ENGLISH)); | ||
configured = true; | ||
|
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
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,25 @@ | ||
--- ../src-base/minecraft/org/bukkit/plugin/PluginLogger.java | ||
+++ ../src-work/minecraft/org/bukkit/plugin/PluginLogger.java | ||
@@ -22,14 +22,20 @@ | ||
public PluginLogger(Plugin context) { | ||
super(context.getClass().getCanonicalName(), null); | ||
String prefix = context.getDescription().getPrefix(); | ||
- pluginName = prefix != null ? new StringBuilder().append("[").append(prefix).append("] ").toString() : "[" + context.getDescription().getName() + "] "; | ||
+ // Crucible start - give plugins a proper prefix for log4j | ||
+ //pluginName = prefix != null ? new StringBuilder().append("[").append(prefix).append("] ").toString() : "[" + context.getDescription().getName() + "] "; | ||
+ pluginName = prefix != null ? prefix : context.getDescription().getName(); | ||
+ // Crucible end | ||
setParent(context.getServer().getLogger()); | ||
setLevel(Level.ALL); | ||
} | ||
|
||
@Override | ||
public void log(LogRecord logRecord) { | ||
- logRecord.setMessage(pluginName + logRecord.getMessage()); | ||
+ // Crucible start - fix log4j prefix | ||
+ //logRecord.setMessage(pluginName + logRecord.getMessage()); | ||
+ logRecord.setLoggerName(pluginName); | ||
+ // Crucible end | ||
super.log(logRecord); | ||
} | ||
|
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
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
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
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
Oops, something went wrong.