Waterfall/BungeeCord-Patches/0045-Allow-plugins-to-use-SLF4J-for-logging.patch
Minecrell d3dc2d3748 Implement full console command completion
Drop the original console command completion patch and rewrite it
for JLine 3. Add support to complete command names instead of just
command arguments.

The additional single thread executor for command completion was
dropped because it's redundant: since the command completer needs
to wait for it to complete anyway, we might as well do the completion
directly from the console thread.
2017-09-26 19:37:34 +01:00

60 lines
1.9 KiB
Diff

From 63cc4ea5e8cfa3859cc98e54f5dd5eb44943a5cb Mon Sep 17 00:00:00 2001
From: Minecrell <dev@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 2a3c5eae..25d870d1 100644
--- 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
index 78045e1d..d078cd68 100644
--- a/log4j/pom.xml
+++ b/log4j/pom.xml
@@ -34,6 +34,11 @@
<artifactId>log4j-jul</artifactId>
<version>2.9.1</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>2.9.1</version>
+ </dependency>
<dependency>
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
--
2.14.1