public static boolean verbose = System.getProperty("ibex.log.verbose", "false").equals("true");
public static boolean logDates = System.getProperty("ibex.log.dates", "false").equals("true");
public static boolean notes = System.getProperty("ibex.log.notes.on", "true").equals("true");
+ public static boolean stackTraces = System.getProperty("ibex.log.stackTraces", "true").equals("true");
public static int maximumNoteLength = Integer.parseInt(System.getProperty("ibex.log.notes.maximumLength", (1024 * 32)+""));
public static boolean rpc = false;
public static Date lastDate = null;
}
byte[] b = baos.toByteArray();
BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(b)));
- String s = null;
try {
- String m = "";
- while((s = br.readLine()) != null) m += s + "\n";
- if (m.length() > 0) log(o, m.substring(0, m.length() - 1), level);
+ if (stackTraces) {
+ String s = null;
+ String m = "";
+ 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);
+ }
+ lastClassName = "";
} catch (IOException e) {
// FEATURE: use org.ibex.io.Stream's here
- logstream.println(colorize(RED, true, "Logger: exception thrown by ByteArrayInputStream; this should not happen"));
+ logstream.println(colorize(RED, true, "Logger: exception thrown by ByteArrayInputStream;" +
+ " this should not happen"));
}
- lastClassName = "";
return;
}