All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.dot.DebugTrace Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// 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();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy