--- projects/cms/source/util/uk/org/iscream/cms/util/FormatName.java 2001/02/25 20:32:50 1.5 +++ projects/cms/source/util/uk/org/iscream/cms/util/FormatName.java 2001/03/15 00:44:31 1.9 @@ -1,5 +1,5 @@ //---PACKAGE DECLARATION--- -package uk.ac.ukc.iscream.util; +package uk.org.iscream.util; //---IMPORTS--- import java.util.Date; @@ -13,7 +13,7 @@ import java.util.Locale; * a toString String to send to the logger. * * @author $Author: tdb $ - * @version $Id: FormatName.java,v 1.5 2001/02/25 20:32:50 tdb Exp $ + * @version $Id: FormatName.java,v 1.9 2001/03/15 00:44:31 tdb Exp $ */ public class FormatName { @@ -21,7 +21,7 @@ public class FormatName { /** * An array of names of verbosity levels. - * Thus logging messages are now "classed" by the level" + * Thus logging messages are now "classed" by the level */ private final static String[] VERBOSITY_NAMES = {"FATAL ", "ERROR ", "WARNING", "SYSMSG ", "SYSINIT", "DEBUG "}; @@ -64,12 +64,12 @@ public class FormatName { * @return The string to be written to the log. */ public static String formatLogLine(String source, int verbosity, String message){ - String date = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(new Date()); + String date = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, Locale.UK).format(new Date()); return "[" + date + "] [" + VERBOSITY_NAMES[verbosity] + "] " + source + ": " + message; } /** - * If the class name begins with uk.ac.ukc.iscream + * If the class name begins with uk.org.iscream * this method will trim it off, otherwise it * leaves the string unchanged. * @@ -78,8 +78,9 @@ public class FormatName { * @return the tidy version of it */ private static String tidyClassName(String className) { - if (className.startsWith("uk.ac.ukc.iscream")) { - return className.substring(18); + String prefix = "uk.org.iscream"; + if (className.startsWith(prefix)) { + return className.substring(prefix.length()); } return className; }