From c75b27a22ea6d8ec07908f89ba3f9fbebc118566 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 22 Sep 2017 13:15:32 +0200 Subject: [PATCH] Allow plugins to use SLF4J for logging --- ...low-plugins-to-use-SLF4J-for-logging.patch | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 BungeeCord-Patches/0046-Allow-plugins-to-use-SLF4J-for-logging.patch diff --git a/BungeeCord-Patches/0046-Allow-plugins-to-use-SLF4J-for-logging.patch b/BungeeCord-Patches/0046-Allow-plugins-to-use-SLF4J-for-logging.patch new file mode 100644 index 0000000..9d4bb5d --- /dev/null +++ b/BungeeCord-Patches/0046-Allow-plugins-to-use-SLF4J-for-logging.patch @@ -0,0 +1,59 @@ +From ad4690306c4a0c322abb7f098a0f539740660b4a Mon Sep 17 00:00:00 2001 +From: Minecrell +Date: Fri, 22 Sep 2017 13:15:09 +0200 +Subject: [PATCH] Allow plugins to use SLF4J for logging + + +diff --git a/api/pom.xml b/api/pom.xml +index 2a3c5eae..25d870d1 100644 +--- a/api/pom.xml ++++ b/api/pom.xml +@@ -43,5 +43,12 @@ + ${project.version} + compile + ++ ++ ++ ++ org.slf4j ++ slf4j-api ++ 1.7.25 ++ + + +diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/Plugin.java b/api/src/main/java/net/md_5/bungee/api/plugin/Plugin.java +index e85b4914..2e5ae4fb 100644 +--- a/api/src/main/java/net/md_5/bungee/api/plugin/Plugin.java ++++ b/api/src/main/java/net/md_5/bungee/api/plugin/Plugin.java +@@ -27,6 +27,12 @@ public class Plugin + @Getter + private Logger logger; + ++ // Waterfall start - Allow plugins to use SLF4J for logging ++ public org.slf4j.Logger getSLF4JLogger() { ++ return org.slf4j.LoggerFactory.getLogger(logger.getName()); ++ } ++ // Waterfall end ++ + /** + * Called when the plugin has just been loaded. Most of the proxy will not + * be initialized, so only use it for registering +diff --git a/log4j/pom.xml b/log4j/pom.xml +index 78045e1d..d078cd68 100644 +--- a/log4j/pom.xml ++++ b/log4j/pom.xml +@@ -34,6 +34,11 @@ + log4j-jul + 2.9.1 + ++ ++ org.apache.logging.log4j ++ log4j-slf4j-impl ++ 2.9.1 ++ + + com.lmax + disruptor +-- +2.14.1 +