Make PluginProviderContext#getLogger return ComponentLogger, remove PluginProviderContext#getSLF4JLogger (#8921)

This commit is contained in:
Jason Penilla
2023-02-26 12:13:15 -07:00
parent 017665b793
commit 5542f6997e
2 changed files with 25 additions and 30 deletions

View File

@@ -250,11 +250,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package io.papermc.paper.plugin.bootstrap;
+
+import io.papermc.paper.plugin.configuration.PluginMeta;
+import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+import java.nio.file.Path;
+import java.util.logging.Logger;
+
+/**
+ * Represents the context provided to a {@link PluginBootstrap} during both the bootstrapping and plugin
@@ -288,17 +288,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return the logger instance
+ */
+ @NotNull
+ Logger getLogger();
+ ComponentLogger getLogger();
+
+ /**
+ * Provides the SLF4J logger assigned to this plugin.
+ *
+ * @return SLF4J logger
+ */
+ @NotNull
+ default org.slf4j.Logger getSLF4JLogger() {
+ return org.slf4j.LoggerFactory.getLogger(this.getLogger().getName());
+ }
+}
diff --git a/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java b/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java
new file mode 100644