Revision: 3526 http://vexi.svn.sourceforge.net/vexi/?rev=3526&view=rev Author: clrg Date: 2009-06-23 17:02:51 +0000 (Tue, 23 Jun 2009)
Log Message: ----------- A collection of syntax-only changes that have been in my workspace for too long Modified Paths: -------------- trunk/core/org.ibex.util/src/org/ibex/util/Log.java Modified: trunk/core/org.ibex.util/src/org/ibex/util/Log.java =================================================================== --- trunk/core/org.ibex.util/src/org/ibex/util/Log.java 2009-06-23 16:59:28 UTC (rev 3525) +++ trunk/core/org.ibex.util/src/org/ibex/util/Log.java 2009-06-23 17:02:51 UTC (rev 3526) @@ -31,7 +31,7 @@ * Based on the org.ibex.util.Log. * * @author a...@ibex.org - * @author m...@vexi.org + * @author mike.good...@cantab.net */ public class Log { @@ -131,9 +131,9 @@ public static final int ERROR = 3; public static final int SILENT = Integer.MAX_VALUE; public static int sLevel = WARN; // INFO - Default during development - public static int uLevel = INFO; + public static int uLevel = INFO; - + // useful colors for output private static final int BLUE = 34; private static final int GREEN = 32; private static final int CYAN = 36; @@ -151,21 +151,17 @@ "\033[0m"; } - - - - - private static void sLog(Object o, Object message, int level){ + private static void sLog(Object o, Object message, int level) { if (level < Log.sLevel) return; log(o, null, message, level, true); } - public static void uLog(Object major, Object minor, Object message, int level){ + public static void uLog(Object major, Object minor, Object message, int level) { if (level < Log.uLevel) return; log(major, minor, message, level, false); } - + // Info to describing the source of the logging. The 'major' is // printed on its own line (if it was different to the last major) // the minor is preprended to the log (and so has to be less than ~INDENT chars) @@ -255,7 +251,7 @@ } String str = message.toString(); -// UNUSED if (str.indexOf('\n') != -1) lastWhere = ""; + // UNUSED if (str.indexOf('\n') != -1) lastWhere = ""; while(str.indexOf('\t') != -1) str = str.substring(0, str.indexOf('\t')) + " " + str.substring(str.indexOf('\t') + 1); @@ -272,21 +268,21 @@ } String whereMinor = null; - if(!major.equals(lastMajor)){ - if(minor!=null || where.length()+2>INDENT){ + if (!major.equals(lastMajor)) { + if(minor!=null || where.length()+2>INDENT) { logstream.println(where); - }else{ + } else { whereMinor = where; } lastMajor = major; lastMinor = null; } - if(whereMinor==null) whereMinor = (minor!=null && !minor.equals(lastMinor))? ""+minor + ": ":""; + if (whereMinor==null) whereMinor = (minor!=null && !minor.equals(lastMinor))? ""+minor + ": ":""; while (whereMinor.length() < INDENT) whereMinor = " " + whereMinor; whereMinor = colorize(GRAY,false,whereMinor); - while(str.indexOf('\n') != -1) { + while (str.indexOf('\n') != -1) { logstream.println(whereMinor + colorize(levelcolor, bright, str.substring(0, str.indexOf('\n')))); whereMinor = colorize(GRAY,false,BLANKINDENT); str = str.substring(str.indexOf('\n') + 1); @@ -305,13 +301,13 @@ } else if (major instanceof String) where = (String)major; else where = major.getClass().getName(); - if(system) + if (system) where = "[S] " + where; //if (where.length() > (logDates ? 14 : 20)) where = where.substring(0, (logDates ? 14 : 20)); //while (where.length() < (logDates ? 14 : 20)) where = " " + where; where = where + ": ";// (where.trim().length() == 0 ? " " : ); - if(cal!=null) + if (cal!=null) where = formatTime.format(cal.getTime()) + where; return where; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Are you an open source citizen? Join us for the Open Source Bridge conference! Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn