protected static void log(weka.core.logging.Logger.Level level,String message){
  try {
    File logFile=new File(WEKA_HOME.toString() + File.separator + "weka.log");
    BufferedWriter writer=new BufferedWriter(new FileWriter(logFile,true));
    SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String linefeed=System.getProperty("line.separator");
    String m=format.format(new Date()) + " " + level+ ": "+ message+ linefeed;
    writer.write(m);
    writer.flush();
    writer.close();
  }
 catch (  Exception ex) {
  }
}

protected static void log ( weka . core . logging . Logger . Level level , String message ) { try { File logFile = new File ( WEKA_HOME . toString ( ) + File . separator + "weka.log" ) ; BufferedWriter writer = new BufferedWriter ( new FileWriter ( logFile , true ) ) ; SimpleDateFormat format = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; String linefeed = System . getProperty ( "line.separator" ) ; String m = format . format ( new Date ( ) ) + " " + level + ": " + message + linefeed ; writer . write ( m ) ; writer . flush ( ) ; writer . close ( ) ; } catch ( Exception ex ) { } }
write to the weka log
