1
0
forked from s444409/POB_2019
POB_2019/Java/zad3_1/FileLogger.java
2019-04-14 13:42:06 +02:00

18 lines
494 B
Java

package POB_2019.Java.zad3_1;
import java.io.FileWriter;
import java.io.IOException;
public class FileLogger extends Logger {
private FileWriter fileWriter;
public FileLogger() throws IOException {
String fileName = "./log.txt";
this.fileWriter = new FileWriter(fileName);
}
@Override
public void log(String textToLog) throws IOException {
this.fileWriter.append(textToLog);
this.fileWriter.append("\n");
fileWriter.flush();
}
}