- while((s = br.readLine()) != null) {
- System.err.print(classname);
- for(int i=0; i<s.length(); i++)
- System.err.print(s.charAt(i) == '\t' ? " " : ("" + s.charAt(i)));
- System.err.println();
- }
- } catch (Exception e) { }
+ while((s = br.readLine()) != null) log(o, s);
+ } catch (IOException e) {
+ System.err.println("Logger: exception thrown by ByteArrayInputStream -- this should not happen");
+ }
+ return;
+ }
+
+ String str = message.toString();
+ while(str.indexOf('\t') != -1)
+ str = str.substring(0, str.indexOf('\t')) + " " + str.substring(str.indexOf('\t') + 1);
+
+ while(str.indexOf('\n') != -1) {
+ System.err.println(classname + str.substring(0, str.indexOf('\n')));
+ str = str.substring(str.indexOf('\n') + 1);
+ }
+ System.err.println(classname + str);
+ }
+
+ public static void recursiveLog(String indent, String name, Object o) throws JSExn {
+ if (!name.equals("")) name += " : ";
+
+ if (o == null) {
+ Log.logJS(indent + name + "<null>");
+
+ } else if (o instanceof JSArray) {
+ Log.logJS(indent + name + "<array>");
+ JSArray na = (JSArray)o;
+ for(int i=0; i<na.length(); i++)
+ recursiveLog(indent + " ", i + "", na.elementAt(i));
+
+ } else if (o instanceof JS) {
+ Log.logJS(indent + name + "<object>");
+ 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 {
+ Log.logJS(indent + name + o);