try { syslog.write(log, 0, log.length()); if (!log.endsWith("\n")) { syslog.newLine(); } syslog.flush(); } catch (IOException ioe) { System.out.println("Couldn't write to syslog!"); } System.out.println(log); }
String orig = log; if (syslog == null) { if (syslogBuffer == null) syslogBuffer = ""; syslogBuffer += log; if (!log.endsWith("\n")) syslogBuffer += "\n"; } else { if (syslogBuffer != null && syslogBuffer.length() > 0) log = syslogBuffer + log; try { syslog.write(log, 0, log.length()); if (!log.endsWith("\n")) { syslog.newLine(); } syslog.flush(); } catch (IOException ioe) { System.out.println("Warning: Couldn't write to syslog!"); } } System.out.println(orig); }
  public void log(String log) {    try {      syslog.write(log, 0, log.length());      if (!log.endsWith("\n")) {        syslog.newLine();      }      syslog.flush();    } catch (IOException ioe) {      System.out.println("Couldn't write to syslog!");    }    System.out.println(log);  }