2018-07-20 03:30:56 +02:00
|
|
|
From 34006bf32ef70c80581b239aa6853d1da9cc2fbd Mon Sep 17 00:00:00 2001
|
2018-07-06 23:00:08 +02:00
|
|
|
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/pom.xml b/api/pom.xml
|
2018-07-06 23:00:08 +02:00
|
|
|
index 48bd8a54..0e46cbbe 100644
|
2017-09-22 13:15:32 +02:00
|
|
|
--- a/api/pom.xml
|
|
|
|
+++ b/api/pom.xml
|
|
|
|
@@ -43,5 +43,12 @@
|
|
|
|
<version>${project.version}</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 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
|
2018-07-06 23:00:08 +02:00
|
|
|
index 36fceb93..a085a39c 100644
|
2017-09-22 13:15:32 +02:00
|
|
|
--- a/log4j/pom.xml
|
|
|
|
+++ b/log4j/pom.xml
|
2018-07-06 23:00:08 +02:00
|
|
|
@@ -38,6 +38,12 @@
|
2017-09-22 13:15:32 +02:00
|
|
|
<artifactId>log4j-jul</artifactId>
|
2018-07-06 23:00:08 +02:00
|
|
|
<version>${log4j2.version}</version>
|
2017-09-22 13:15:32 +02:00
|
|
|
</dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.logging.log4j</groupId>
|
|
|
|
+ <artifactId>log4j-slf4j-impl</artifactId>
|
2018-07-06 23:00:08 +02:00
|
|
|
+ <version>${log4j2.version}</version>
|
|
|
|
+ <scope>runtime</scope>
|
2017-09-22 13:15:32 +02:00
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.lmax</groupId>
|
|
|
|
<artifactId>disruptor</artifactId>
|
|
|
|
--
|
2018-07-06 23:00:08 +02:00
|
|
|
2.18.0
|
2017-09-22 13:15:32 +02:00
|
|
|
|