From: adam Date: Sat, 30 Oct 2004 22:51:42 +0000 (+0000) Subject: smarter logging of exception stack traces X-Git-Url: http://git.megacz.com/?p=org.ibex.util.git;a=commitdiff_plain;h=899d88d0e5a73afcff81d25ea493f8e2cbba429c smarter logging of exception stack traces darcs-hash:20041030225142-5007d-aec982f8fc3831ba3afca6cedb1eaf1ab14e555e.gz --- diff --git a/src/org/ibex/util/Log.java b/src/org/ibex/util/Log.java index 5c67f68..aef3ba2 100644 --- a/src/org/ibex/util/Log.java +++ b/src/org/ibex/util/Log.java @@ -177,10 +177,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) {