From 160c7c7c0ddf721253a40fb97aa4abdb6813510a 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 f72ac5c0..10db38b7 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -55,5 +55,11 @@ 1.26 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 9660234d..3d1e9a3a 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 @@ -44,6 +44,13 @@ public class Plugin // init( proxy, description ); } + // 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 e49a40ee..1cd12d6a 100644 --- a/log4j/pom.xml +++ b/log4j/pom.xml @@ -38,6 +38,12 @@ log4j-jul ${log4j2.version} + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j2.version} + runtime + com.lmax disruptor -- 2.29.0.windows.1