From 03c0530e4536d194afa0556c45e07f4d4df35439 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 13 May 2008 14:05:21 +0000 Subject: [PATCH] use nicer date formatter git-svn-id: http://trooper/svn/projects/jSite/trunk@862 c3eda9e8-030b-0410-8277-bc7414b0a119 --- src/net/pterodactylus/util/logging/Logging.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/net/pterodactylus/util/logging/Logging.java b/src/net/pterodactylus/util/logging/Logging.java index 9b25ff3..fe2fb54 100644 --- a/src/net/pterodactylus/util/logging/Logging.java +++ b/src/net/pterodactylus/util/logging/Logging.java @@ -19,6 +19,8 @@ package net.pterodactylus.util.logging; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -82,13 +84,14 @@ public class Logging { consoleHandler.setLevel(Level.ALL); consoleHandler.setFormatter(new Formatter() { private StringBuffer recordBuffer = new StringBuffer(); + private DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS Z"); /** * {@inheritDoc} */ @Override public synchronized String format(LogRecord record) { recordBuffer.setLength(0); - recordBuffer.append(new Date(record.getMillis())).append(' ').append(record.getLevel().getName()).append(' '); + recordBuffer.append(dateFormatter.format(new Date(record.getMillis()))).append(' ').append(record.getLevel().getName()).append(' '); recordBuffer.append(record.getSourceClassName()).append('.').append(record.getSourceMethodName()).append(' '); recordBuffer.append(record.getMessage()); recordBuffer.append("\r\n"); -- 2.7.4