From 450edc300442a98a82389ed02d9b605d93fa5ecf Mon Sep 17 00:00:00 2001 From: EdGruberman Date: Sat, 11 Aug 2012 16:29:50 -0700 Subject: [PATCH] Use standard format function to format logs. Addresses BUKKIT-2246 Also fix "excess" Log Levels. --- src/main/java/net/minecraft/server/ConsoleLogFormatter.java | 4 ++-- .../org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraft/server/ConsoleLogFormatter.java b/src/main/java/net/minecraft/server/ConsoleLogFormatter.java index 943bb95295..6a58493c4e 100644 --- a/src/main/java/net/minecraft/server/ConsoleLogFormatter.java +++ b/src/main/java/net/minecraft/server/ConsoleLogFormatter.java @@ -39,11 +39,11 @@ final class ConsoleLogFormatter extends Formatter { stringbuilder.append(" [WARNING] "); } else if (level == Level.SEVERE) { stringbuilder.append(" [SEVERE] "); - } else if (level == Level.SEVERE) { + } else { // CraftBukkit stringbuilder.append(" [").append(level.getLocalizedName()).append("] "); } - stringbuilder.append(logrecord.getMessage()); + stringbuilder.append(formatMessage(logrecord)); // CraftBukkit stringbuilder.append('\n'); Throwable throwable = logrecord.getThrown(); diff --git a/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java b/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java index 42885fdef5..2dbfef963c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java +++ b/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java @@ -46,7 +46,7 @@ public class ShortConsoleLogFormatter extends Formatter { builder.append(" ["); builder.append(record.getLevel().getLocalizedName().toUpperCase()); builder.append("] "); - builder.append(record.getMessage()); + builder.append(formatMessage(record)); builder.append('\n'); if (ex != null) {