try { logFile.write(nodeEventDescription); } catch (Exception e) {
synchronized (logFileLock) {  try { logFile.write(nodeEventDescription); } catch (Exception e) { System.out.println("Exception writing to log file: " + e); }
  public void handle(NodeServesClient nsc, NodeEvent nodeEvent) {    final NodeEvent myNodeEvent = nodeEvent; // for swing utilities    final int nodeEventType = nodeEvent.getType();    final String nodeEventDescription = getNodeEventDescription(nodeEvent);    // write stdout/stderr/etc to log file    try {      logFile.write(nodeEventDescription);    } catch (Exception e) {    }    // ignore events user isn't interested in    if (filter != null && !filter.includeEventInDisplay(nodeEvent))      return;    final SimpleAttributeSet style = getNodeEventStyle(nodeEventType);    double nodeEventValue = 0;    long nodeTimestamp = 0;    if (nodeEventType == NodeEvent.IDLE_UPDATE) {      String s = nodeEvent.getMessage();      nodeEventValue = getIdleness(s);      nodeTimestamp = getTimestamp(s);    }    final double idleTime = nodeEventValue;    final long timestamp = nodeTimestamp;    // must use swing "invokeLater" to be thread-safe    try {      SwingUtilities.invokeLater(new Runnable() {	public void run() {          if (nodeEventType == NodeEvent.IDLE_UPDATE)             handleIdleUpdate(idleTime, timestamp);          else {            updateStatus(myNodeEvent);            doc.appendString(nodeEventDescription, style);          }	}      });    } catch (RuntimeException e) {    }  }