--- projects/cms/source/util/uk/org/iscream/cms/util/FormatName.java 2001/02/26 00:46:17 1.7 +++ projects/cms/source/util/uk/org/iscream/cms/util/FormatName.java 2002/05/21 16:47:19 1.14 @@ -1,5 +1,25 @@ +/* + * i-scream central monitoring system + * http://www.i-scream.org.uk + * Copyright (C) 2000-2002 i-scream + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + //---PACKAGE DECLARATION--- -package uk.ac.ukc.iscream.util; +package uk.org.iscream.cms.server.util; //---IMPORTS--- import java.util.Date; @@ -13,7 +33,7 @@ import java.util.Locale; * a toString String to send to the logger. * * @author $Author: tdb $ - * @version $Id: FormatName.java,v 1.7 2001/02/26 00:46:17 tdb Exp $ + * @version $Id: FormatName.java,v 1.14 2002/05/21 16:47:19 tdb Exp $ */ public class FormatName { @@ -64,12 +84,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, Locale.UK).format(new Date()); + String date = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).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.cms.server * this method will trim it off, otherwise it * leaves the string unchanged. * @@ -78,8 +98,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.cms.server"; + if (className.startsWith(prefix)) { + return className.substring(prefix.length()+1); } return className; }