X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Futil%2FLog.java;h=67163d9aed2aad449285f53d5bdaa918eeda7980;hb=1f80106afa0f0eb6f12544c75304f2084aca6499;hp=5c67f687ca5c458e3408bfd186a9b460287e1b11;hpb=1b3b2be9450b956167aaf542b02028f13440831d;p=org.ibex.util.git diff --git a/src/org/ibex/util/Log.java b/src/org/ibex/util/Log.java index 5c67f68..67163d9 100644 --- a/src/org/ibex/util/Log.java +++ b/src/org/ibex/util/Log.java @@ -1,12 +1,8 @@ -// Copyright (C) 2003 Adam Megacz all rights reserved. -// -// You may modify, copy, and redistribute this code under the terms of -// the GNU Library Public License version 2.1, with the exception of -// the portion of clause 6a after the semicolon (aka the "obnoxious -// relink clause") +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache Public Source License 2.0 ("the License"). +// You may not use this file except in compliance with the License. package org.ibex.util; -import org.ibex.js.*; import java.io.*; import java.util.*; import java.net.*; @@ -177,10 +173,20 @@ public class Log { while((s = br.readLine()) != null) m += s + "\n"; if (m.length() > 0) log(o, m.substring(0, m.length() - 1), level); } else { - message = br.readLine(); - String s = br.readLine(); - if (s.indexOf('(') != -1) message = message + " " + s.substring(s.indexOf('(')); - log(o, message, level); + String m = br.readLine(); + int ok = 0; + do { + String s = br.readLine(); + if (s == null) break; + if (s.indexOf('(') != -1) { + String shortened = s.substring(s.indexOf('(')+1); + shortened = shortened.substring(0, shortened.indexOf(')')); + m += " " + shortened; + if (ok > 1) m = m.substring(0, 78); + ok++; + } + } while (m.length() < 78); + log(o, m, level); } lastClassName = ""; } catch (IOException e) { @@ -217,33 +223,4 @@ public class Log { logstream.println(classname + colorize(levelcolor, bright, str)); } - public static void recursiveLog(String indent, String name, Object o) throws JSExn { - if (!name.equals("")) name += " : "; - - if (o == null) { - JS.log(indent + name + ""); - - } else if (o instanceof JSArray) { - JS.log(indent + name + ""); - JSArray na = (JSArray)o; - for(int i=0; i"); - JS s = (JS)o; - Enumeration e = s.keys(); - while(e.hasMoreElements()) { - Object key = e.nextElement(); - if (key != null) - recursiveLog(indent + " ", key.toString(), - (key instanceof Integer) ? - s.get(((Integer)key)) : s.get(key.toString())); - } - } else { - JS.log(indent + name + o); - - } - } - }