mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
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.
This commit is contained in:
parent
1caeaef01d
commit
31a575f5f7
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ public abstract class JavaPlugin extends PluginBase {
|
||||||
private boolean naggable = true;
|
private boolean naggable = true;
|
||||||
private FileConfiguration newConfig = null;
|
private FileConfiguration newConfig = null;
|
||||||
private File configFile = null;
|
private File configFile = null;
|
||||||
private PluginLogger logger = null;
|
private Logger logger = null; // Paper - PluginLogger -> Logger
|
||||||
|
|
||||||
public JavaPlugin() {
|
public JavaPlugin() {
|
||||||
// Paper start
|
// Paper start
|
||||||
|
@ -304,8 +304,8 @@ public abstract class JavaPlugin extends PluginBase {
|
||||||
this.dataFolder = dataFolder;
|
this.dataFolder = dataFolder;
|
||||||
this.classLoader = classLoader;
|
this.classLoader = classLoader;
|
||||||
this.configFile = new File(dataFolder, "config.yml");
|
this.configFile = new File(dataFolder, "config.yml");
|
||||||
this.logger = new PluginLogger(this);
|
|
||||||
this.pluginMeta = configuration; // Paper
|
this.pluginMeta = configuration; // Paper
|
||||||
|
this.logger = Logger.getLogger(description.getPrefix() != null ? description.getPrefix() : description.getName()); // Paper - Handle plugin prefix in implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue