1 22 23 package org.jboss.logging.jdk; 24 25 import java.util.logging.Logger ; 26 import java.util.logging.Level ; 27 28 import org.jboss.logging.LoggerPlugin; 29 30 35 public class JDK14LoggerPlugin implements LoggerPlugin 36 { 37 private Logger log; 38 39 public void init(String name) 40 { 41 log = Logger.getLogger(name); 42 } 43 44 public boolean isTraceEnabled() 45 { 46 return log.isLoggable(Level.FINER); 47 } 48 49 public void trace(Object message) 50 { 51 log.finer(message.toString()); 52 } 53 54 public void trace(Object message, Throwable t) 55 { 56 log.log(Level.FINER, message.toString(), t); 57 } 58 59 public boolean isDebugEnabled() 60 { 61 return log.isLoggable(Level.FINE); 62 } 63 64 public void debug(Object message) 65 { 66 log.fine(message.toString()); 67 } 68 69 public void debug(Object message, Throwable t) 70 { 71 log.log(Level.FINE, message.toString(), t); 72 } 73 74 public boolean isInfoEnabled() 75 { 76 return log.isLoggable(Level.INFO); 77 } 78 79 public void info(Object message) 80 { 81 log.info(message.toString()); 82 } 83 84 public void info(Object message, Throwable t) 85 { 86 log.log(Level.INFO, message.toString(), t); 87 } 88 89 public void warn(Object message) 90 { 91 log.warning(message.toString()); 92 } 93 94 public void warn(Object message, Throwable t) 95 { 96 log.log(Level.WARNING, message.toString(), t); 97 } 98 99 public void error(Object message) 100 { 101 log.severe(message.toString()); 102 } 103 104 public void error(Object message, Throwable t) 105 { 106 log.log(Level.SEVERE, message.toString(), t); 107 } 108 109 public void fatal(Object message) 110 { 111 log.severe(message.toString()); 112 } 113 114 public void fatal(Object message, Throwable t) 115 { 116 log.log(Level.SEVERE, message.toString(), t); 117 } 118 } 119 | Popular Tags |