mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 09:42:05 +01:00
Fix SysoutCatcher when plugins log before initialisation (Fixes #6323)
This commit is contained in:
parent
9a74e70cc0
commit
6226208d64
1 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ Subject: [PATCH] Add System.out.println catcher
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/logging/SysoutCatcher.java b/src/main/java/io/papermc/paper/logging/SysoutCatcher.java
|
diff --git a/src/main/java/io/papermc/paper/logging/SysoutCatcher.java b/src/main/java/io/papermc/paper/logging/SysoutCatcher.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..e61b58f607dc83f5bb73b6cde50f3e8303849385
|
index 0000000000000000000000000000000000000000..fd2af675d32e497fabd35f57b9e7c53ece97e6bd
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/io/papermc/paper/logging/SysoutCatcher.java
|
+++ b/src/main/java/io/papermc/paper/logging/SysoutCatcher.java
|
||||||
@@ -0,0 +1,56 @@
|
@@ -0,0 +1,56 @@
|
||||||
|
@ -58,7 +58,7 @@ index 0000000000000000000000000000000000000000..e61b58f607dc83f5bb73b6cde50f3e83
|
||||||
+ plugin.getDescription().getAuthors(),
|
+ plugin.getDescription().getAuthors(),
|
||||||
+ plugin.getName())
|
+ plugin.getName())
|
||||||
+ );
|
+ );
|
||||||
+ } catch (final IllegalArgumentException e) {
|
+ } catch (final IllegalArgumentException | IllegalStateException e) {
|
||||||
+ // If anything happens, the calling class doesn't exist, there is no JavaPlugin that "owns" the calling class, etc
|
+ // If anything happens, the calling class doesn't exist, there is no JavaPlugin that "owns" the calling class, etc
|
||||||
+ // Just print out normally, with some added information
|
+ // Just print out normally, with some added information
|
||||||
+ Bukkit.getLogger().log(this.level, String.format("[%s] %s %s", this.prefix, clazz.getName(), line));
|
+ Bukkit.getLogger().log(this.level, String.format("[%s] %s %s", this.prefix, clazz.getName(), line));
|
||||||
|
|
Loading…
Reference in a new issue