mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
71c18fd5c9
This simply provides the base API to create the objects. Further commits will come that adds adds usage of this API to existing GameProfile based API's, as well as new API's.
44 lines
1.9 KiB
Diff
44 lines
1.9 KiB
Diff
From f27a613d49050d6941376ec69d0efa182cab743c Mon Sep 17 00:00:00 2001
|
|
From: Minecrell <dev@minecrell.net>
|
|
Date: Thu, 21 Sep 2017 16:14:13 +0200
|
|
Subject: [PATCH] Handle plugin prefixes in implementation logging
|
|
configuration
|
|
|
|
Currently, plugin prefixes are prepended to the log message in
|
|
the PluginLogger before passing the message to the underlying
|
|
logging framework. This is bad design because they need to be
|
|
stripped manually when using custom appenders to log messages
|
|
in a different format.
|
|
|
|
Additionally, it makes integration of alternative logging APIs hard
|
|
because all logging must go through the PluginLogger. Avoid using
|
|
PluginLogger and create a regular logger using the plugin name.
|
|
The implementation should handle plugin prefixes by displaying
|
|
logger names when appropriate.
|
|
|
|
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
|
|
index 16b1eb37..0abad9ad 100644
|
|
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
|
|
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
|
|
@@ -50,7 +50,7 @@ public abstract class JavaPlugin extends PluginBase {
|
|
private boolean naggable = true;
|
|
private FileConfiguration newConfig = null;
|
|
private File configFile = null;
|
|
- private PluginLogger logger = null;
|
|
+ private Logger logger = null; // Paper - PluginLogger -> Logger
|
|
|
|
public JavaPlugin() {
|
|
final ClassLoader classLoader = this.getClass().getClassLoader();
|
|
@@ -277,7 +277,8 @@ public abstract class JavaPlugin extends PluginBase {
|
|
this.dataFolder = dataFolder;
|
|
this.classLoader = classLoader;
|
|
this.configFile = new File(dataFolder, "config.yml");
|
|
- this.logger = new PluginLogger(this);
|
|
+ // Paper - Handle plugin prefix in implementation
|
|
+ this.logger = Logger.getLogger(description.getPrefix() != null ? description.getPrefix() : description.getName());
|
|
}
|
|
|
|
/**
|
|
--
|
|
2.15.1
|
|
|