Skip to content

Commit

Permalink
A fix for pre-init Loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Sep 8, 2018
1 parent bbcacd2 commit db69c1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GalaxiAPI/src/net/ME1312/Galaxi/Plugin/PluginInfo.java
Expand Up @@ -44,7 +44,7 @@ public static PluginInfo getPluginInfo(Object main) throws InvocationTargetExcep
if (!pluginMap.keySet().contains(mainClass)) {

try {
String name = mainClass.getAnnotation(Plugin.class).name().replaceAll("#|<|\\$|\\+|%|>|!|`|&|\\*|'|\\||\\{|\\?|\"|=|}|/|\\\\|\\s|@|\\.|\\n", "-");
String name = mainClass.getAnnotation(Plugin.class).name().replaceAll("<|>|:|\\*|\\||\\?|\"|/|\\\\|\\n", "-");
String display = mainClass.getAnnotation(Plugin.class).name();
Version version = Version.fromString(mainClass.getAnnotation(Plugin.class).version());
Version signature = (mainClass.getAnnotation(Plugin.class).signature().length() > 0)?Version.fromString(mainClass.getAnnotation(Plugin.class).signature()):null;
Expand Down
Expand Up @@ -30,12 +30,12 @@ private static void start(PrintStream out, PrintStream err, ConsoleReader in) th
if (Util.isNull(out, err)) throw new NullPointerException();
Field f = Logger.class.getDeclaredField("pso");
f.setAccessible(true);
f.set(null, new Container<PrintStream>(new PrintStream(new FileLogger(new ConsoleStream(in, out)))));
((Container<PrintStream>) f.get(null)).set(new PrintStream(new FileLogger(new ConsoleStream(in, out))));
f.setAccessible(false);

f = Logger.class.getDeclaredField("pse");
f.setAccessible(true);
f.set(null, new Container<PrintStream>(new PrintStream(new FileLogger(new ConsoleStream(in, err)))));
((Container<PrintStream>) f.get(null)).set(new PrintStream(new FileLogger(new ConsoleStream(in, err))));
f.setAccessible(false);

System.setOut(new PrintStream(new SystemLogger(false)));
Expand Down

0 comments on commit db69c1c

Please sign in to comment.