00001 00026 package org.objectweb.jonas_ejb.container; 00027 00028 import org.objectweb.util.monolog.api.BasicLevel; 00029 import org.objectweb.util.monolog.api.Logger; 00030 import org.objectweb.util.monolog.api.LoggerFactory; 00031 import org.objectweb.util.monolog.wrapper.printwriter.LoggerImpl; 00032 00038 class DummyLogger extends LoggerImpl { 00039 00043 public void log(int level, java.lang.Object o) { 00044 } 00045 } 00046 00047 public class TraceEjb { 00048 00049 public static Logger logger = new DummyLogger(); 00050 public static Logger query = new DummyLogger(); 00051 public static Logger interp = new DummyLogger(); 00052 public static Logger genclass = new DummyLogger(); 00053 public static Logger coherence = new DummyLogger(); 00054 public static Logger thread = new DummyLogger(); 00055 public static Logger synchro = new DummyLogger(); 00056 public static Logger ssfpool = new DummyLogger(); 00057 public static Logger swapper = new DummyLogger(); 00058 public static Logger mapper = new DummyLogger(); 00059 public static Logger context = new DummyLogger(); 00060 static public Logger security = new DummyLogger(); 00061 static public Logger factory = new DummyLogger(); 00062 public static Logger mdb = new DummyLogger(); 00063 public static Logger tx = new DummyLogger(); 00064 public static Logger txlistener = new DummyLogger(); 00065 public static Logger dd = new DummyLogger(); 00066 public static Logger loaderlog = new DummyLogger(); 00067 00068 public static final String prefix = "org.objectweb.jonas_ejb"; 00069 00070 public static LoggerFactory loggerFactory = null; 00071 00076 public static void configure(LoggerFactory lf) { 00077 loggerFactory = lf; 00078 logger = lf.getLogger(prefix); 00079 interp = lf.getLogger(prefix + ".interp"); 00080 query = lf.getLogger(prefix + ".query"); 00081 genclass = lf.getLogger(prefix + ".genclass"); 00082 coherence = lf.getLogger(prefix + ".coherence"); 00083 thread = lf.getLogger(prefix + ".thread"); 00084 synchro = lf.getLogger(prefix + ".synchro"); 00085 ssfpool = lf.getLogger(prefix + ".ssfpool"); 00086 swapper = lf.getLogger(prefix + ".swapper"); 00087 mapper = lf.getLogger(prefix + ".mapper"); 00088 context = lf.getLogger(prefix + ".context"); 00089 security = lf.getLogger(prefix + ".security"); 00090 factory = lf.getLogger(prefix + ".factory"); 00091 mdb = lf.getLogger(prefix + ".mdb"); 00092 tx = lf.getLogger(prefix + ".tx"); 00093 txlistener = lf.getLogger(prefix + ".txlistener"); 00094 dd = lf.getLogger(prefix + ".dd"); 00095 loaderlog = lf.getLogger("org.objectweb.jonas.loader"); 00096 } 00097 00098 public static boolean isVerbose() { 00099 return (logger != null) && logger.isLoggable(BasicLevel.WARN); 00100 } 00101 00102 public static boolean isDebugThread() { 00103 return (thread != null) && thread.isLoggable(BasicLevel.DEBUG); 00104 } 00105 00106 public static boolean isDebugSynchro() { 00107 return (synchro != null) && synchro.isLoggable(BasicLevel.DEBUG); 00108 } 00109 00110 public static boolean isDebugSsfpool() { 00111 return (ssfpool != null) && ssfpool.isLoggable(BasicLevel.DEBUG); 00112 } 00113 00114 public static boolean isDebugContext() { 00115 return (context != null) && context.isLoggable(BasicLevel.DEBUG); 00116 } 00117 00118 public static boolean isDebugSwapper() { 00119 return (swapper != null) && swapper.isLoggable(BasicLevel.DEBUG); 00120 } 00121 00122 public static boolean isDebugMapper() { 00123 return (mapper != null) && mapper.isLoggable(BasicLevel.DEBUG); 00124 } 00125 00126 public static boolean isDebugIc() { 00127 return (interp != null) && interp.isLoggable(BasicLevel.DEBUG); 00128 } 00129 00130 public static boolean isDebugSecurity() { 00131 return (security != null) && security.isLoggable(BasicLevel.DEBUG); 00132 } 00133 00134 public static boolean isDebugFactory() { 00135 return (factory != null) && factory.isLoggable(BasicLevel.DEBUG); 00136 } 00137 00138 public static boolean isDebugJms() { 00139 return (mdb != null) && mdb.isLoggable(BasicLevel.DEBUG); 00140 } 00141 00142 public static boolean isDebugTx() { 00143 return (tx != null) && tx.isLoggable(BasicLevel.DEBUG); 00144 } 00145 00146 public static boolean isDebugTxlistener() { 00147 return (txlistener != null) && txlistener.isLoggable(BasicLevel.DEBUG); 00148 } 00149 00150 public static boolean isDebugDd() { 00151 return (dd != null) && dd.isLoggable(BasicLevel.DEBUG); 00152 } 00153 00154 public static boolean isDebugQuery() { 00155 return (query != null) && query.isLoggable(BasicLevel.DEBUG); 00156 } 00157 00158 }