X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Futil%2FLog.java;h=de7fe8dbc9523f6caedb95787d6a50c88872a27f;hp=1766be928234a71e7de40c3f35b66001d158bc24;hb=01732f3955ae92c0520283b44f52d1ec69f9f9f2;hpb=b4cbe7980419f21ef890b407e6d7e6e8026ca71e diff --git a/src/org/ibex/util/Log.java b/src/org/ibex/util/Log.java index 1766be9..de7fe8d 100644 --- a/src/org/ibex/util/Log.java +++ b/src/org/ibex/util/Log.java @@ -15,6 +15,7 @@ import java.net.*; public class Log { public static boolean on = true; + public static boolean rpc = false; public static boolean color = false; public static boolean verbose = false; public static boolean logDates = false; @@ -73,11 +74,14 @@ public class Log { private static String lastClassName = null; private static synchronized void log(Object o, Object message, int level) { - if (level > Log.level) return; + if (level < Log.level) return; if (firstMessage && !logDates) { firstMessage = false; logstream.println(colorize(GREEN, false, "===========================================================================")); - diag(Log.class, "Logging enabled at " + new java.util.Date()); + + // FIXME later: causes problems with method pruning + //diag(Log.class, "Logging enabled at " + new java.util.Date()); + if (color) diag(Log.class, "logging messages in " + colorize(BLUE, true, "c") + colorize(RED, true, "o") + @@ -126,14 +130,16 @@ public class Log { try { String m = ""; while((s = br.readLine()) != null) m += s + "\n"; - log(o, m.substring(0, m.length() - 1), level); + if (m.length() > 0) log(o, m.substring(0, m.length() - 1), level); } catch (IOException e) { logstream.println(colorize(RED, true, "Logger: exception thrown by ByteArrayInputStream -- this should not happen")); } + lastClassName = ""; return; } String str = message.toString(); + if (str.indexOf('\n') != -1) lastClassName = ""; while(str.indexOf('\t') != -1) str = str.substring(0, str.indexOf('\t')) + " " + str.substring(str.indexOf('\t') + 1);