X-Git-Url: http://git.phpeclipse.com diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/LogProxy.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/LogProxy.java new file mode 100644 index 0000000..2c592c1 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/LogProxy.java @@ -0,0 +1,34 @@ +package com.quantum.view; + +import java.io.PrintWriter; +import java.io.StringWriter; + +public class LogProxy implements LogConstants { + private static LogProxy instance = null; + private SQLLogView log = null; + private LogProxy() { + } + public synchronized static LogProxy getInstance() { + if (instance == null) { + instance = new LogProxy(); + } + return instance; + } + public void addText(int type, String text) { + log = SQLLogView.getInstance(); + if (log != null) { + log.addText(type, text); + } + } + + public void addText(int type, String text, Exception e) { + addText(type, text); + StringWriter writer = new StringWriter(); + e.printStackTrace(new PrintWriter(writer)); + addText(type, writer.toString()); + } + + public void addText(int type, Exception e) { + addText(type, "Error occured: " + e, e); //$NON-NLS-1$ + } +}