Logging code back in

This commit is contained in:
taoneill 2012-06-19 00:18:31 -04:00
parent a1634b8b94
commit 0557d94911

View File

@ -96,7 +96,7 @@ public class War extends JavaPlugin {
private final TeamConfigBag teamDefaultConfig = new TeamConfigBag(); private final TeamConfigBag teamDefaultConfig = new TeamConfigBag();
private SpoutDisplayer spoutMessenger = null; private SpoutDisplayer spoutMessenger = null;
//private Logger warLogger; private Logger warLogger;
private HubLobbyMaterials warhubMaterials = new HubLobbyMaterials(20, (byte)0, 5, (byte)0, 49, (byte)0, 89, (byte)0); // default floor glass, outline planks, gate obsidian, light glowstone private HubLobbyMaterials warhubMaterials = new HubLobbyMaterials(20, (byte)0, 5, (byte)0, 49, (byte)0, 89, (byte)0); // default floor glass, outline planks, gate obsidian, light glowstone
@ -249,21 +249,21 @@ public class War extends JavaPlugin {
this.getServer().getScheduler().scheduleSyncRepeatingTask(this, fadeOutMessagesTask, 100, 100); this.getServer().getScheduler().scheduleSyncRepeatingTask(this, fadeOutMessagesTask, 100, 100);
} }
// // Get own log file // Get own log file
// try { try {
// // Create an appending file handler // Create an appending file handler
// new File(this.getDataFolder() + "/temp/").mkdir(); new File(this.getDataFolder() + "/temp/").mkdir();
// FileHandler handler = new FileHandler(this.getDataFolder() + "/temp/war.log", true); FileHandler handler = new FileHandler(this.getDataFolder() + "/temp/war.log", true);
//
// // Add to War-specific logger // Add to War-specific logger
// this.warLogger = Logger.getLogger("com.tommytony.War.log"); this.warLogger = Logger.getLogger("com.tommytony.War.log");
// this.warLogger.setUseParentHandlers(false); this.warLogger.setUseParentHandlers(false);
// Formatter formatter = new WarLogFormatter(); Formatter formatter = new WarLogFormatter();
// handler.setFormatter(formatter); handler.setFormatter(formatter);
// this.warLogger.addHandler(handler); this.warLogger.addHandler(handler);
// } catch (IOException e) { } catch (IOException e) {
// this.getLogger().log(Level.WARNING, "Failed to create War log file"); this.getLogger().log(Level.WARNING, "Failed to create War log file");
// } }
this.log("War v" + this.desc.getVersion() + " is on.", Level.INFO); this.log("War v" + this.desc.getVersion() + " is on.", Level.INFO);
} }
@ -878,9 +878,9 @@ public class War extends JavaPlugin {
// Log to Bukkit console // Log to Bukkit console
this.getLogger().log(lvl, str); this.getLogger().log(lvl, str);
// if (this.warLogger != null) { if (this.warLogger != null) {
// this.warLogger.log(lvl, str); this.warLogger.log(lvl, str);
// } }
} }
// the only way to find a zone that has only one corner // the only way to find a zone that has only one corner