diff options
author | Chris Ward <chris@chrisgward.com> | 2013-01-09 22:05:12 +1100 |
---|---|---|
committer | Chris Ward <chris@chrisgward.com> | 2013-01-09 22:05:12 +1100 |
commit | 1ccbf8dd68be8a77a8437ca17f41ddb56befb2f6 (patch) | |
tree | f769647274dc6a207d4ff0d6a51baa5f4339c735 /EssentialsXMPP | |
parent | dca47a117d75a6d1a668380c1fa72ab91fc9b724 (diff) | |
download | Essentials-1ccbf8dd68be8a77a8437ca17f41ddb56befb2f6.tar Essentials-1ccbf8dd68be8a77a8437ca17f41ddb56befb2f6.tar.gz Essentials-1ccbf8dd68be8a77a8437ca17f41ddb56befb2f6.tar.lz Essentials-1ccbf8dd68be8a77a8437ca17f41ddb56befb2f6.tar.xz Essentials-1ccbf8dd68be8a77a8437ca17f41ddb56befb2f6.zip |
Use the right formatter in XMPP
9ecb501e005bbd1d7723d0680b40cd85810af41b
Diffstat (limited to 'EssentialsXMPP')
-rw-r--r-- | EssentialsXMPP/src/net/ess3/xmpp/XMPPManager.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/EssentialsXMPP/src/net/ess3/xmpp/XMPPManager.java b/EssentialsXMPP/src/net/ess3/xmpp/XMPPManager.java index ac6dddff6..740046894 100644 --- a/EssentialsXMPP/src/net/ess3/xmpp/XMPPManager.java +++ b/EssentialsXMPP/src/net/ess3/xmpp/XMPPManager.java @@ -2,10 +2,9 @@ package net.ess3.xmpp; import java.io.File; import java.util.*; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.LogRecord; -import java.util.logging.Logger; +import java.util.logging.*; + +import com.avaje.ebeaninternal.server.transaction.log.SimpleLogger; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; import net.ess3.api.IReload; @@ -21,6 +20,7 @@ import org.jivesoftware.smack.util.StringUtils; public final class XMPPManager extends Handler implements MessageListener, ChatManagerListener, IReload { private static final Logger LOGGER = Logger.getLogger("Minecraft"); + private static final SimpleFormatter formatter = new SimpleFormatter(); private transient YamlConfiguration config = null; private transient XMPPConnection connection; private transient ChatManager chatManager; @@ -261,8 +261,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM XMPPManager.this.startChat(user); for (LogRecord logRecord : copy) { - final String message = String.format( - "[" + logRecord.getLevel().getLocalizedName() + "] " + logRecord.getMessage(), logRecord.getParameters()); + final String message = formatter.format(logRecord); if (!XMPPManager.this.sendMessage(user, message)) { failedUsers.add(user); |