From: david Date: Fri, 30 Jan 2004 07:43:10 +0000 (+0000) Subject: 2003/12/24 10:14:44 X-Git-Tag: RC3~249 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c615f4047ab0ba626ad94975551e73a11449e189;p=org.ibex.core.git 2003/12/24 10:14:44 darcs-hash:20040130074310-0c9ea-1bc882bd96b294d138cb72882ac0aca1fee96f5a.gz --- diff --git a/src/org/xwt/util/Log.java b/src/org/xwt/util/Log.java index 1eb61ef..c700289 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 Date lastDate = null; + public static int lastDate = 0; /** true iff nothing has yet been logged */ public static boolean firstMessage = true; @@ -66,15 +66,18 @@ public class Log { classname = classname + ": "; if (logDates) { - Date d = new Date(); - if (lastDate == null || d.getYear() != lastDate.getYear() || d.getMonth() != lastDate.getMonth() || d.getDay() != lastDate.getDay()) { + 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; 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; }