1 package asia.tcrs.ccnp.chemicraftnext;
4 import java.io.FileNotFoundException;
5 import java.io.FileWriter;
6 import java.io.IOException;
8 public class ChemiCraftLogging {
10 private FileWriter outStream;
11 private String directoryPath;
14 public ChemiCraftLogging(String directoryPath) {
15 this.directoryPath = directoryPath;
18 public void startLogging() {
19 this.file = new File(this.directoryPath + "/ChemiCraft.log");
20 if (!this.file.exists()) {
22 this.file.createNewFile();
23 } catch (IOException e) {
29 this.outStream = new FileWriter(this.file);
30 } catch (FileNotFoundException e) {
32 } catch (IOException e) {
37 public void write(String writeStr) {
40 this.outStream.write(writeStr);
41 } catch (IOException e) {
46 public void write(String writeStr, EnumLoggingType type) {
61 throw new IllegalStateException();
64 this.outStream.write(s + "\n");
65 this.outStream.flush();
66 } catch (IOException e) {