Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.plugin.PluginLogger Class Reference
Inheritance diagram for org.bukkit.plugin.PluginLogger:

Public Member Functions

 PluginLogger (Plugin context)
void log (LogRecord logRecord)

Detailed Description

The PluginLogger class is a modified Logger that prepends all logging calls with the name of the plugin doing the logging. The API for PluginLogger is exactly the same as Logger.

See also

Definition at line 14 of file PluginLogger.java.

Constructor & Destructor Documentation

org.bukkit.plugin.PluginLogger.PluginLogger ( Plugin  context)

Creates a new PluginLogger that extracts the name from a plugin.

contextA reference to the plugin

Definition at line 22 of file PluginLogger.java.

References org.bukkit.plugin.Plugin.getDescription(), org.bukkit.Server.getLogger(), org.bukkit.plugin.PluginDescriptionFile.getName(), org.bukkit.plugin.PluginDescriptionFile.getPrefix(), and org.bukkit.plugin.Plugin.getServer().

22  {
23  super(context.getClass().getCanonicalName(), null);
24  String prefix = context.getDescription().getPrefix();
25  pluginName = prefix != null ? new StringBuilder().append("[").append(prefix).append("] ").toString() : "[" + context.getDescription().getName() + "] ";
26  setParent(context.getServer().getLogger());
27  setLevel(Level.ALL);
28  }

The documentation for this class was generated from the following file: