X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Futil%2FLog.java;h=ebc835171ba325d0c097889d917dcb9bdebe79ea;hb=80fcec8be56d0f948d08930219768a7a4f343dd2;hp=2659b269386982afbacd3ae87ce1f5f9857bdd75;hpb=7d45644e15a837386fe18331c36a647dcc17e839;p=org.ibex.util.git diff --git a/src/org/ibex/util/Log.java b/src/org/ibex/util/Log.java index 2659b26..ebc8351 100644 --- a/src/org/ibex/util/Log.java +++ b/src/org/ibex/util/Log.java @@ -18,6 +18,8 @@ import java.net.Socket; import java.net.InetAddress; import java.text.SimpleDateFormat; +// FEATURE: logging exceptions should automatically unwrap exceptions + /** Easy to use logger. * * @author adam@ibex.org @@ -70,7 +72,7 @@ public class Log { } public static void clearnotes() { if (!notes) return; notebuf().setLength(0); } - private static final Basket.Map notebufs = new Basket.HashMap(); + private static final Basket.Map notebufs = new Basket.Hash(); public static StringBuffer notebuf() { StringBuffer ret = (StringBuffer)notebufs.get(Thread.currentThread()); if (ret == null) { @@ -198,7 +200,7 @@ public class Log { String shortened = s.substring(s.indexOf('(')+1); shortened = shortened.substring(0, shortened.indexOf(')')); m += " " + shortened; - if (ok > 1) m = m.substring(0, 78); + if (ok > 1) m = m.substring(0, Math.min(m.length(), 78)); ok++; } } while (m.length() < 78);