formula-manager/source/Logger.java
2018-07-01 13:14:51 -04:00

36 lines
932 B
Java

/*
* Decompiled with CFR 0_123.
*/
package com.zakscode.FormulaManager;
import com.zakscode.FormulaManager.Configuration;
import com.zakscode.FormulaManager.Main;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintStream;
class Logger {
Logger() {
}
public static void write(Exception e) {
if (!Boolean.parseBoolean(Main.conf.getProperty("debug"))) {
File file = new File(Main.baseDir + "log.txt");
try {
FileOutputStream fos = new FileOutputStream(file, true);
PrintStream ps = new PrintStream(fos);
e.printStackTrace(ps);
ps.append('\n');
ps.flush();
ps.close();
}
catch (FileNotFoundException fos) {}
} else {
e.printStackTrace();
}
}
}