1 43 package org.objectweb.jotm; 44 45 import java.io.PrintWriter ; 46 47 51 public class TraceTimer { 52 53 static public boolean isDebug = false; static public boolean isVerbose = false; static public PrintWriter logWriter = null; 57 60 static public void setDebug(boolean set) { 61 isDebug = set; 62 } 63 64 67 static public void setVerbose(boolean set) { 68 isVerbose = set; 69 } 70 71 74 static public void setLogWriter(PrintWriter log) { 75 logWriter = log; 76 } 77 78 81 static public void verbose(String msg) { 82 if ((isVerbose) && (logWriter != null)) 83 logWriter.println(msg); 84 } 85 86 89 static public void debug(String msg) { 90 if ((isDebug) && (logWriter != null)) 91 logWriter.println(msg); 92 } 93 94 97 static public void error(String msg) { 98 if (logWriter != null) 99 logWriter.println(msg); 100 } 101 102 105 static public void error(String msg, Throwable th) { 106 if (logWriter != null) { 107 logWriter.println(msg); 108 th.printStackTrace(logWriter); 109 } 110 } 111 112 } 113 | Popular Tags |