/** Print message with exception stack trace */
 protected void print(String msg, Throwable e) {
   StringBuffer sb = new StringBuffer();
   sb.append(getName());
   sb.append(": ");
   sb.append(msg);
   sb.append("\n");
   if (e != null) {
     sb.append(StringUtil.stackTraceString(e));
   }
   System.out.print(sb.toString());
 }
 /** Return agent name for messages. Default is to return java instance name. */
 protected String getName() {
   return StringUtil.shortName(this);
 }