Also these questions about how the Logger program is used in the Dukascopy environment:Why do you think the Logger class is usable? Where did you get it?How does your code call the Logger class's constructor? What statements have: new Logger() in them?
How does your code call the Logger class's methods?
If you did not write the code, how did it get this statement in it?What was in the code before you added that statement? If you look at the code in the constructor you can see that the value of logFile is replaced:private String logFile = "C:/Users/Bob/Documents/BM_mod14.log";so giving it any value is useless because it is replaced in the constructor.logFile = lf;
--- Update ---
Try this:import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.io.*; //IOException; import java.util.HashSet; import java.util.Vector; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Set; import java.util.TimeZone; class IConsole { PrintStream getOut() { return System.out; } } class Logger { private IConsole console = null; private String logFile = "C:/Users/Bob/Documents/BM_mod14.log"; private boolean info = true; private boolean error = true; private boolean debug = true; public Logger(IConsole cons, String lf, boolean inf, boolean err, boolean dbg) { console = cons; logFile = lf; info = inf; error = err; debug = dbg; if (!"".equals(lf)) new File(logFile).delete(); } public void info(String Data) { if (info) { Data = "INFO : " + Data; Log(Data); } } public void error(String Data) { if (error) { Data = "ERROR : " + Data; Log(Data); } } public void debug(String Data) { if (debug) { Data = "DEBUG : " + Data; Log(Data); } } private void Log(String Data) { try { if (console != null) console.getOut().println(Data); LogToFile(Data); } catch (Exception e) { } } private void LogToFile(String Data) { try { if ("".equals(Data)) return; if ("".equals(logFile)) return; File file = new File(logFile); FileOutputStream fos = new FileOutputStream(file, true); OutputStreamWriter osw = new OutputStreamWriter(fos, "Cp1252" /* "ISO-8859-1" */); BufferedWriter bw = new BufferedWriter(osw); try { bw.write(Data + "\n"); } finally { try { bw.flush(); bw.close(); } catch (IOException e) { System.out.println("Error: " + e.getMessage()); e.printStackTrace(); } try { osw.flush(); osw.close(); } catch (IOException e) { System.out.println("Error: " + e.getMessage()); e.printStackTrace(); } try { fos.flush(); fos.close(); } catch (IOException e) { System.out.println("Error: " + e.getMessage()); e.printStackTrace(); } } } catch (IOException e) { System.out.println("Error: " + e.getMessage()); e.printStackTrace(); } } // end LogToFile public static void main(String[] args) { // add code here to declare an instance of the logger class Logger l = new Logger(new IConsole(), "BobsLog.txt", false, false, false); l.Log("This is a test 2"); } // end main } // end of class Logger