added a FEATURE comment
[org.ibex.util.git] / src / org / ibex / util / Log.java
index 2659b26..ebc8351 100644 (file)
@@ -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);