/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package buzzerproxy; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Enger */ public class Logging { public final String SAVE_FILE = "/home/java/BuzzerProxyLogging.txt"; public void appendFile(String str) { if (str == null || !(str instanceof String)){ Exception e = new Exception(); Logger.getLogger(Logging.class.getName()).log(Level.SEVERE, null, e); System.exit(1); } // if ( rawResults == null || !(rawResults instanceof String)){ FileWriter out = null; try { out = new FileWriter(SAVE_FILE, true); } catch (IOException ex) { Logger.getLogger(Logging.class.getName()).log(Level.SEVERE, null, ex); } BufferedWriter writer = new BufferedWriter(out); try { writer.write(str); } catch (IOException ex) { Logger.getLogger(Logging.class.getName()).log(Level.SEVERE, null, ex); } try { writer.close(); } catch (IOException ex) { Logger.getLogger(Logging.class.getName()).log(Level.SEVERE, null, ex); } } // public void appendFile(String str) { } // public class Logging {