net.sourceforge.plantuml.dot.DebugTrace Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.dot;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import net.sourceforge.plantuml.security.SFile;
public class DebugTrace {
// ::remove file when __CORE__
private static final SFile out = new SFile("debug" + System.currentTimeMillis() + ".txt");
private static PrintWriter pw;
private synchronized static PrintWriter getPrintWriter() {
if (pw == null) {
try {
pw = out.createPrintWriter();
} catch (FileNotFoundException e) {
}
}
return pw;
}
public synchronized static void DEBUG(String s) {
final PrintWriter pw = getPrintWriter();
pw.println(s);
pw.flush();
}
public synchronized static void DEBUG(String s, Throwable t) {
DEBUG(s);
t.printStackTrace(pw);
pw.flush();
}
}