diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-13 17:33:27 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-15 13:28:59 -0500 |
commit | 83d29e461c85733f0113b6eb19db6e3b42da2949 (patch) | |
tree | b3063a1c28f478ab368d5ba3413a842def68c28f /src/main/java/net/minecraft/server/ConsoleLogFormatter.java | |
parent | ba6e4c38cfa98ad291974195cc46d70a4f138ac1 (diff) | |
download | craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.gz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.lz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.xz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.zip |
Update CraftBukkit to Minecraft 1.5
Diffstat (limited to 'src/main/java/net/minecraft/server/ConsoleLogFormatter.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ConsoleLogFormatter.java | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/src/main/java/net/minecraft/server/ConsoleLogFormatter.java b/src/main/java/net/minecraft/server/ConsoleLogFormatter.java index 6a58493c..60d26d58 100644 --- a/src/main/java/net/minecraft/server/ConsoleLogFormatter.java +++ b/src/main/java/net/minecraft/server/ConsoleLogFormatter.java @@ -9,41 +9,32 @@ import java.util.logging.LogRecord; import java.util.regex.Pattern; // CraftBukkit -final class ConsoleLogFormatter extends Formatter { +class ConsoleLogFormatter extends Formatter { - private SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - // CraftBukkit start - add color stripping, change constructor to take it + private SimpleDateFormat b; + + final ConsoleLogManager a; + // CraftBukkit start - add color stripping private Pattern pattern = Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]"); private boolean strip = false; + // CraftBukkit end - ConsoleLogFormatter(boolean strip) { - this.strip = strip; + private ConsoleLogFormatter(ConsoleLogManager consolelogmanager) { + this.a = consolelogmanager; + this.b = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + this.strip = MinecraftServer.getServer().options.has("log-strip-color"); // CraftBukkit } - // CraftBukkit end public String format(LogRecord logrecord) { StringBuilder stringbuilder = new StringBuilder(); - stringbuilder.append(this.a.format(Long.valueOf(logrecord.getMillis()))); - Level level = logrecord.getLevel(); - - if (level == Level.FINEST) { - stringbuilder.append(" [FINEST] "); - } else if (level == Level.FINER) { - stringbuilder.append(" [FINER] "); - } else if (level == Level.FINE) { - stringbuilder.append(" [FINE] "); - } else if (level == Level.INFO) { - stringbuilder.append(" [INFO] "); - } else if (level == Level.WARNING) { - stringbuilder.append(" [WARNING] "); - } else if (level == Level.SEVERE) { - stringbuilder.append(" [SEVERE] "); - } else { // CraftBukkit - stringbuilder.append(" [").append(level.getLocalizedName()).append("] "); + stringbuilder.append(this.b.format(Long.valueOf(logrecord.getMillis()))); + if (ConsoleLogManager.a(this.a) != null) { + stringbuilder.append(ConsoleLogManager.a(this.a)); } - stringbuilder.append(formatMessage(logrecord)); // CraftBukkit + stringbuilder.append(" [").append(logrecord.getLevel().getName()).append("] "); + stringbuilder.append(this.formatMessage(logrecord)); stringbuilder.append('\n'); Throwable throwable = logrecord.getThrown(); @@ -62,4 +53,8 @@ final class ConsoleLogFormatter extends Formatter { } // CraftBukkit end } + + ConsoleLogFormatter(ConsoleLogManager consolelogmanager, EmptyClass3 emptyclass3) { + this(consolelogmanager); + } } |