Added the PHP wizards again
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.sql / src / net / sourceforge / phpdt / sql / view / LogProxy.java
index a97de7f..cf5ff06 100644 (file)
@@ -1,5 +1,8 @@
 package net.sourceforge.phpdt.sql.view;
 
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
 public class LogProxy implements LogConstants {
        private static LogProxy instance = null;
        private SQLLogView log = null;
@@ -17,4 +20,15 @@ public class LogProxy implements LogConstants {
                        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$
+    }
 }