Waterfall/BungeeCord-Patches/0036-Allow-plugins-to-use-SLF4J-for-logging.patch

57 lines
1.9 KiB
Diff
Raw Normal View History

2023-09-21 12:33:23 +02:00
From 0c79b259f553abdc617e0aa12b53f54d3e47a7d1 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
2017-09-22 13:15:32 +02:00
Date: Fri, 22 Sep 2017 13:15:09 +0200
Subject: [PATCH] Allow plugins to use SLF4J for logging
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
2017-09-22 13:15:32 +02:00
--- 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 );
}
2017-09-22 13:15:32 +02:00
+ // Waterfall start - Allow plugins to use SLF4J for logging
+ public org.slf4j.Logger getSLF4JLogger() {
+ return org.slf4j.LoggerFactory.getLogger(logger.getName());
+ }
+ // Waterfall end
+
2017-09-22 13:15:32 +02:00
+
/**
* 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
2023-09-21 12:33:23 +02:00
index 1cc7936e..e83b2f21 100644
2017-09-22 13:15:32 +02:00
--- a/log4j/pom.xml
+++ b/log4j/pom.xml
2023-06-04 19:12:26 +02:00
@@ -38,6 +38,24 @@
2018-07-22 18:40:31 +02:00
<artifactId>log4j-jul</artifactId>
<version>${log4j2.version}</version>
2017-09-22 13:15:32 +02:00
</dependency>
2018-07-22 18:40:31 +02:00
+ <dependency>
2017-09-22 13:15:32 +02:00
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j2.version}</version>
+ <scope>runtime</scope>
2023-06-04 19:12:26 +02:00
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.36</version>
+ <scope>runtime</scope>
2017-09-22 13:15:32 +02:00
+ </dependency>
2018-07-22 18:40:31 +02:00
<dependency>
2017-09-22 13:15:32 +02:00
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
--
2023-09-21 12:33:23 +02:00
2.42.0
2017-09-22 13:15:32 +02:00