From 1468496caebca328c762ef4d0a26b62650af4442 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 30 Jan 2004 07:43:12 +0000 Subject: [PATCH] 2003/12/24 21:41:05 darcs-hash:20040130074312-0c9ea-dd0b137146aeb6af699dbd7ad5ee307283476b4a.gz --- src/org/xwt/util/Log.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/org/xwt/util/Log.java b/src/org/xwt/util/Log.java index c700289..1eb61ef 100644 --- a/src/org/xwt/util/Log.java +++ b/src/org/xwt/util/Log.java @@ -16,7 +16,7 @@ public class Log { public static boolean on = true; public static boolean verbose = false; public static boolean logDates = false; - public static int lastDate = 0; + public static Date lastDate = null; /** true iff nothing has yet been logged */ public static boolean firstMessage = true; @@ -66,18 +66,15 @@ public class Log { classname = classname + ": "; if (logDates) { - Calendar c = GregorianCalendar.getInstance(); - Date d = c.getTime(); - int change = c.get(Calendar.DAY_OF_YEAR) + c.get(Calendar.YEAR); - - if (change != lastDate) { - lastDate = change; + Date d = new Date(); + if (lastDate == null || d.getYear() != lastDate.getYear() || d.getMonth() != lastDate.getMonth() || d.getDay() != lastDate.getDay()) { String now = new java.text.SimpleDateFormat("EEE dd MMM yyyy").format(d); System.err.println(); System.err.println("=== " + now + " =========================================================="); } java.text.DateFormat df = new java.text.SimpleDateFormat("[EEE HH:mm:ss] "); classname = df.format(d) + classname; + lastDate = d; } -- 1.7.10.4