1 7 package org.jboss.logging; 8 9 import java.util.logging.Logger ; 10 import java.util.logging.Level ; 11 12 17 public class JDK14LoggerPlugin implements LoggerPlugin 18 { 19 private Logger log; 20 21 public void init(String name) 22 { 23 log = Logger.getLogger(name); 24 } 25 26 public boolean isTraceEnabled() 27 { 28 return log.isLoggable(Level.FINER); 29 } 30 31 public void trace(Object message) 32 { 33 log.finer(message.toString()); 34 } 35 36 public void trace(Object message, Throwable t) 37 { 38 log.log(Level.FINER, message.toString(), t); 39 } 40 41 public boolean isDebugEnabled() 42 { 43 return log.isLoggable(Level.FINE); 44 } 45 46 public void debug(Object message) 47 { 48 log.fine(message.toString()); 49 } 50 51 public void debug(Object message, Throwable t) 52 { 53 log.log(Level.FINE, message.toString(), t); 54 } 55 56 public boolean isInfoEnabled() 57 { 58 return log.isLoggable(Level.INFO); 59 } 60 61 public void info(Object message) 62 { 63 log.info(message.toString()); 64 } 65 66 public void info(Object message, Throwable t) 67 { 68 log.log(Level.INFO, message.toString(), t); 69 } 70 71 public void warn(Object message) 72 { 73 log.warning(message.toString()); 74 } 75 76 public void warn(Object message, Throwable t) 77 { 78 log.log(Level.WARNING, message.toString(), t); 79 } 80 81 public void error(Object message) 82 { 83 log.severe(message.toString()); 84 } 85 86 public void error(Object message, Throwable t) 87 { 88 log.log(Level.SEVERE, message.toString(), t); 89 } 90 91 public void fatal(Object message) 92 { 93 log.severe(message.toString()); 94 } 95 96 public void fatal(Object message, Throwable t) 97 { 98 log.log(Level.SEVERE, message.toString(), t); 99 } 100 } 101 | Popular Tags |