Changeset 303


Ignore:
Timestamp:
12/13/11 16:28:37 (13 years ago)
Author:
sherbold
Message:
  • replaced default java FileWriter? with custom one using UTF-16
  • added XML header to generated log file
Location:
trunk/JFCMonitor/src/de/ugoe/cs/eventbench/jfcmonitor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JFCMonitor/src/de/ugoe/cs/eventbench/jfcmonitor/JFCListener.java

    r296 r303  
    3838        public JFCListener(OutputStreamWriter outputWriter) { 
    3939                this.outputWriter = outputWriter; 
     40                try { 
     41                        outputWriter.write("<?xml version=\"1.0\" encoding=\"UTF-16\"?>" + ENDLINE); 
     42                        outputWriter.write("<sessions>" + ENDLINE); 
     43                } catch (IOException e) { 
     44                        System.err.println("JFCMONITOR -- Failure writing to log: " 
     45                                        + e.getMessage()); 
     46                } 
    4047        } 
    4148 
  • trunk/JFCMonitor/src/de/ugoe/cs/eventbench/jfcmonitor/Runner.java

    r295 r303  
    44import java.awt.Toolkit; 
    55import java.awt.event.AWTEventListener; 
    6 import java.io.FileWriter; 
     6import java.io.FileOutputStream; 
    77import java.io.IOException; 
    88import java.io.OutputStreamWriter; 
     
    4545                                + ".log"; 
    4646 
    47                 FileWriter writer; 
     47                FileOutputStream fis; 
     48                OutputStreamWriter writer; 
    4849                try { 
    4950                        // the writer is not closed explicitly! 
    50                         writer = new FileWriter(logfileName, true); 
    51                         writer.write("<newsession />"); 
     51                        fis = new FileOutputStream(logfileName, true); 
     52                        writer = new OutputStreamWriter(fis, "UTF-16"); 
    5253                } catch (IOException e) { 
    5354                        System.err.println("JFCMONITOR -- failure opening logfile: " 
Note: See TracChangeset for help on using the changeset viewer.