summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-22 20:27:09 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-22 20:27:09 +0000
commitd5a0cc5cb00efa2a061b13cc08be1df5ff3c5602 (patch)
tree8842b6745159a8dde18e2880bf385536911f8189
parent1c5d9b1db02cba3a131153630144994bb28c6f72 (diff)
downloadEssentials-d5a0cc5cb00efa2a061b13cc08be1df5ff3c5602.tar
Essentials-d5a0cc5cb00efa2a061b13cc08be1df5ff3c5602.tar.gz
Essentials-d5a0cc5cb00efa2a061b13cc08be1df5ff3c5602.tar.lz
Essentials-d5a0cc5cb00efa2a061b13cc08be1df5ff3c5602.tar.xz
Essentials-d5a0cc5cb00efa2a061b13cc08be1df5ff3c5602.zip
More debug messages, if debug: true is set.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1521 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java19
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java15
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/Teleport.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpall.java5
7 files changed, 58 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java
index ea29711f4..fde60aeba 100644
--- a/Essentials/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials/src/com/earth2me/essentials/Essentials.java
@@ -460,7 +460,7 @@ public class Essentials extends JavaPlugin
}
catch (Throwable ex)
{
- sender.sendMessage(ChatColor.RED + "Error: " + ex.getMessage());
+ sender.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
if (getSettings().isDebug())
{
logger.log(Level.WARNING, Util.format("errorCallingCommand", commandLabel), ex);
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
index 495a3c619..ef8263765 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
@@ -1,6 +1,8 @@
package com.earth2me.essentials;
import java.util.ArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.bukkit.*;
import org.bukkit.block.*;
import org.bukkit.craftbukkit.block.CraftSign;
@@ -11,6 +13,7 @@ import org.bukkit.inventory.ItemStack;
public class EssentialsBlockListener extends BlockListener
{
private final Essentials ess;
+ private static final Logger logger = Logger.getLogger("Minecraft");
public final static ArrayList<Material> protectedBlocks = new ArrayList<Material>(4);
static
@@ -150,6 +153,10 @@ public class EssentialsBlockListener extends BlockListener
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
}
}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
index a29168b42..10ec0438d 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
@@ -1,5 +1,7 @@
package com.earth2me.essentials;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.bukkit.Material;
import org.bukkit.block.Sign;
import org.bukkit.craftbukkit.block.CraftSign;
@@ -12,6 +14,7 @@ import org.bukkit.inventory.ItemStack;
public class EssentialsEcoBlockListener extends BlockListener
{
Essentials ess;
+ private static final Logger logger = Logger.getLogger("Minecraft");
public EssentialsEcoBlockListener(Essentials ess)
{
@@ -88,6 +91,10 @@ public class EssentialsEcoBlockListener extends BlockListener
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
}
return;
}
@@ -120,6 +127,10 @@ public class EssentialsEcoBlockListener extends BlockListener
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
event.setLine(0, "§4[Buy]");
event.setLine(1, "#");
event.setLine(2, "Item");
@@ -145,6 +156,10 @@ public class EssentialsEcoBlockListener extends BlockListener
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
event.setLine(0, "§4[Sell]");
event.setLine(1, "#");
event.setLine(2, "Item");
@@ -202,6 +217,10 @@ public class EssentialsEcoBlockListener extends BlockListener
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
event.setLine(0, "§4[Trade]");
event.setLine(1, "# ItemOr" + ess.getSettings().getCurrencySymbol());
event.setLine(2, "# ItemOr" + ess.getSettings().getCurrencySymbol() + ":#");
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
index 20f2f29c0..4c7b56d1c 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
@@ -1,6 +1,8 @@
package com.earth2me.essentials;
import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.bukkit.Material;
import org.bukkit.block.Sign;
import org.bukkit.craftbukkit.block.CraftSign;
@@ -13,6 +15,7 @@ import org.bukkit.inventory.ItemStack;
public class EssentialsEcoPlayerListener extends PlayerListener
{
Essentials ess;
+ private static final Logger logger = Logger.getLogger("Minecraft");
EssentialsEcoPlayerListener(Essentials ess)
{
@@ -60,6 +63,10 @@ public class EssentialsEcoPlayerListener extends PlayerListener
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
}
return;
}
@@ -83,6 +90,10 @@ public class EssentialsEcoPlayerListener extends PlayerListener
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
}
return;
}
@@ -189,6 +200,10 @@ public class EssentialsEcoPlayerListener extends PlayerListener
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
}
return;
}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index 464002548..818bc216b 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -478,6 +478,10 @@ public class EssentialsPlayerListener extends PlayerListener
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
}
}
diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java
index 3318aa779..d0f137b9b 100644
--- a/Essentials/src/com/earth2me/essentials/Teleport.java
+++ b/Essentials/src/com/earth2me/essentials/Teleport.java
@@ -2,6 +2,8 @@ package com.earth2me.essentials;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
@@ -46,6 +48,7 @@ public class Teleport implements Runnable
private Target teleportTarget;
private Charge chargeFor;
private Essentials ess;
+ private static final Logger logger = Logger.getLogger("Minecraft");
private void initTimer(long delay, Target target, Charge chargeFor)
{
@@ -97,6 +100,10 @@ public class Teleport implements Runnable
catch (Throwable ex)
{
user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
}
return;
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
index 6cc0c55ca..86311cd2e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
@@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import java.util.logging.Level;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -50,6 +51,10 @@ public class Commandtpall extends EssentialsCommand
catch (Exception ex)
{
sender.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
+ if (ess.getSettings().isDebug())
+ {
+ logger.log(Level.WARNING, ex.getMessage(), ex);
+ }
}
}
}