1 package com.quantum.view;
3 import java.io.PrintWriter;
4 import java.io.StringWriter;
6 public class LogProxy implements LogConstants {
7 private static LogProxy instance = null;
8 private SQLLogView log = null;
11 public synchronized static LogProxy getInstance() {
12 if (instance == null) {
13 instance = new LogProxy();
17 public void addText(int type, String text) {
18 log = SQLLogView.getInstance();
20 log.addText(type, text);
24 public void addText(int type, String text, Exception e) {
26 StringWriter writer = new StringWriter();
27 e.printStackTrace(new PrintWriter(writer));
28 addText(type, writer.toString());
31 public void addText(int type, Exception e) {
32 addText(type, "Error occured: " + e, e); //$NON-NLS-1$