Added Server.getLogger, changed a few anonymous loggers to use it
This commit is contained in:
parent
e529e44d86
commit
3c1255da0c
@ -3,6 +3,7 @@ package org.bukkit;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
@ -113,4 +114,11 @@ public interface Server {
|
|||||||
* Reloads the server, refreshing settings and plugin information
|
* Reloads the server, refreshing settings and plugin information
|
||||||
*/
|
*/
|
||||||
public void reload();
|
public void reload();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the primary logger associated with this server instance
|
||||||
|
*
|
||||||
|
* @return Logger associated with this server
|
||||||
|
*/
|
||||||
|
public Logger getLogger();
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package org.bukkit.fillr;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.plugin.InvalidDescriptionException;
|
import org.bukkit.plugin.InvalidDescriptionException;
|
||||||
@ -30,7 +29,7 @@ public class Getter {
|
|||||||
enablePlugin(reader);
|
enablePlugin(reader);
|
||||||
player.sendMessage("Loading " + reader.getName());
|
player.sendMessage("Loading " + reader.getName());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.getLogger(Getter.class.getName()).log(Level.SEVERE, null, ex);
|
server.getLogger().log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,9 +40,9 @@ public class Getter {
|
|||||||
try {
|
try {
|
||||||
server.getPluginManager().loadPlugin(plugin);
|
server.getPluginManager().loadPlugin(plugin);
|
||||||
} catch (InvalidPluginException ex) {
|
} catch (InvalidPluginException ex) {
|
||||||
Logger.getLogger(Getter.class.getName()).log(Level.SEVERE, null, ex);
|
server.getLogger().log(Level.SEVERE, null, ex);
|
||||||
} catch (InvalidDescriptionException ex) {
|
} catch (InvalidDescriptionException ex) {
|
||||||
Logger.getLogger(Getter.class.getName()).log(Level.SEVERE, null, ex);
|
server.getLogger().log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import org.bukkit.plugin.*;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
public class Updater {
|
public class Updater {
|
||||||
public static String DIRECTORY = Fillr.DIRECTORY;
|
public static String DIRECTORY = Fillr.DIRECTORY;
|
||||||
@ -99,9 +98,9 @@ public class Updater {
|
|||||||
try {
|
try {
|
||||||
server.getPluginManager().loadPlugin(plugin);
|
server.getPluginManager().loadPlugin(plugin);
|
||||||
} catch (InvalidPluginException ex) {
|
} catch (InvalidPluginException ex) {
|
||||||
Logger.getLogger(Getter.class.getName()).log(Level.SEVERE, null, ex);
|
server.getLogger().log(Level.SEVERE, null, ex);
|
||||||
} catch (InvalidDescriptionException ex) {
|
} catch (InvalidDescriptionException ex) {
|
||||||
Logger.getLogger(Getter.class.getName()).log(Level.SEVERE, null, ex);
|
server.getLogger().log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,9 +93,9 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
try {
|
try {
|
||||||
plugin = loadPlugin(file);
|
plugin = loadPlugin(file);
|
||||||
} catch (InvalidPluginException ex) {
|
} catch (InvalidPluginException ex) {
|
||||||
Logger.getLogger(SimplePluginManager.class.getName()).log(Level.SEVERE, "Could not load " + file.getPath() + " in " + directory.getPath() + ": " + ex.getMessage(), ex);
|
server.getLogger().log(Level.SEVERE, "Could not load " + file.getPath() + " in " + directory.getPath() + ": " + ex.getMessage(), ex);
|
||||||
} catch (InvalidDescriptionException ex) {
|
} catch (InvalidDescriptionException ex) {
|
||||||
Logger.getLogger(SimplePluginManager.class.getName()).log(Level.SEVERE, "Could not load " + file.getPath() + " in " + directory.getPath() + ": " + ex.getMessage(), ex);
|
server.getLogger().log(Level.SEVERE, "Could not load " + file.getPath() + " in " + directory.getPath() + ": " + ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin != null) {
|
if (plugin != null) {
|
||||||
@ -224,7 +224,7 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
try {
|
try {
|
||||||
registration.callEvent( event );
|
registration.callEvent( event );
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(SimplePluginManager.class.getName()).log(Level.SEVERE, "Could not pass event " + event.getType() + " to " + registration.getPlugin().getDescription().getName(), ex);
|
server.getLogger().log(Level.SEVERE, "Could not pass event " + event.getType() + " to " + registration.getPlugin().getDescription().getName(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user