log.error("Exception writing to log file: " + e);
log.error("Exception writing to log file: ", e);
  public void handleAll(final NodeServesClient nsc, 			final java.util.List nodeEvents) {    final int n = nodeEvents.size();    if (n <= 0) {      return;    }    // write a description of the event to the log file    synchronized (logFileLock) {      try {        int i = 0;        do {          NodeEvent nodeEvent = (NodeEvent)nodeEvents.get(i);          logFile.write(getNodeEventDescription(nodeEvent));          nLogEvents++;          if (nLogEvents > 100) {            logFile.flush();            nLogEvents = 0;          }        } while (++i < n);      } catch (Exception e) {        if(log.isErrorEnabled()) {          log.error("Exception writing to log file: " + e);        }      }    }    // must use swing "invokeLater" to be thread-safe    // collects descriptions of the same type and batch writes them to display    // handles idle updates separately    try {      SwingUtilities.invokeLater(new Runnable() {	public void run() {	  int prevType = -1;	  String prevDescription = "";	  int nextEventIndex = -1;	  // get the first description which is not an idle update	  for (int i = 0; i < n; i++) {	    NodeEvent nodeEvent = (NodeEvent)nodeEvents.get(i);            //            if (filter != null && !filter.includeEventInDisplay(nodeEvent))            //              continue; // skip events user isn't interested in	    int nodeEventType = nodeEvent.getType();	    if (nodeEventType == NodeEvent.IDLE_UPDATE) {	      String s = nodeEvent.getMessage();	      handleIdleUpdate(getIdleness(s), getTimestamp(s));            } else {	      updateStatus(nodeEvent);              if (filter != null && !filter.includeEventInDisplay(nodeEvent))                continue; // don't append events user isn't interested in	      prevType = nodeEventType;	      prevDescription = getNodeEventDescription(nodeEvent);	      nextEventIndex = i+1;	      break;	    }	  }	  if (nextEventIndex == -1)	    return; // all the events were idle updates or ignored	  // start batching descriptions	  for (int j = nextEventIndex; j < n; j++) {	    NodeEvent nodeEvent = (NodeEvent)nodeEvents.get(j);            //            if (filter != null && !filter.includeEventInDisplay(nodeEvent))            //              continue; // skip events user isn't interested in	    int nodeEventType = nodeEvent.getType();	    String description = getNodeEventDescription(nodeEvent);	    updateStatus(nodeEvent);	    if (nodeEventType == NodeEvent.IDLE_UPDATE) {	      String s = nodeEvent.getMessage();	      handleIdleUpdate(getIdleness(s), getTimestamp(s));	    } else if (nodeEventType == prevType) {	      prevDescription += description;	    } else {              if (filter == null || filter.includeEventTypeInDisplay(prevType))                doc.appendString(prevDescription,                                  getNodeEventStyle(prevType));	      prevDescription = description;	      prevType = nodeEventType;	    }	  }          if (filter == null || filter.includeEventTypeInDisplay(prevType))            doc.appendString(prevDescription,                             getNodeEventStyle(prevType));	}      });    } catch (RuntimeException e) {    }  }