Waterfall/BungeeCord-Patches/0038-Allow-plugins-to-use-SLF4J-for-logging.patch
Shane Freeder cd2ccc6d2c
Updated Upstream (BungeeCord)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
b7935d4b Downgrade SnakeYAML due to issues with comments parsing
00982f36 #3104: Use lambdas rather than reflection to create packets
088b2045 #3109: Made file log level configurable
2021-06-11 21:13:31 +01:00

61 lines
2.0 KiB
Diff

From c2a00dbdee271905c3553c2a733e6e8ee584b541 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
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 338864f8..0680a5a5 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -76,5 +76,11 @@
<version>1.28</version>
<scope>compile</scope>
</dependency>
+ <!-- Waterfall - Add SLF4J -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.25</version>
+ </dependency>
</dependencies>
</project>
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 d5ad0f87..7ec6e530 100644
--- a/log4j/pom.xml
+++ b/log4j/pom.xml
@@ -38,6 +38,12 @@
<artifactId>log4j-jul</artifactId>
<version>${log4j2.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j2.version}</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
--
2.32.0