diff options
Diffstat (limited to 'EssentialsXMPP/src/com/earth2me')
-rw-r--r-- | EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java index 164f40c2a..582c8cbef 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java @@ -11,9 +11,10 @@ import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; +import java.util.logging.SimpleFormatter; import org.bukkit.entity.Player; -import org.jivesoftware.smack.Roster.SubscriptionMode; import org.jivesoftware.smack.*; +import org.jivesoftware.smack.Roster.SubscriptionMode; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Presence; import org.jivesoftware.smack.util.StringUtils; @@ -22,6 +23,7 @@ import org.jivesoftware.smack.util.StringUtils; public class XMPPManager extends Handler implements MessageListener, ChatManagerListener, IConf { private static final Logger LOGGER = Logger.getLogger("Minecraft"); + private static final SimpleFormatter formatter = new SimpleFormatter(); private final transient EssentialsConf config; private transient XMPPConnection connection; private transient ChatManager chatManager; @@ -262,8 +264,8 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager XMPPManager.this.startChat(user); for (LogRecord logRecord : copy) { - final String message = String.format("[" + logRecord.getLevel().getLocalizedName() + "] " + logRecord.getMessage(), logRecord.getParameters()); - if (!XMPPManager.this.sendMessage(user, message)) + final String message = formatter.format(logRecord); + if (!XMPPManager.this.sendMessage(user, Util.stripLogColorFormat(message))) { failedUsers.add(user); break; |