1 23 24 package org.apache.slide.util.logger; 25 26 import org.apache.commons.transaction.util.LoggerFacade; 27 28 33 public class TxLogger implements LoggerFacade { 34 35 protected Logger logger; 36 37 protected String logChannel; 38 39 public TxLogger(Logger logger, String logChannel) { 40 this.logger = logger; 41 this.logChannel = logChannel; 42 } 43 44 public Logger getLogger() { 45 return logger; 46 } 47 48 public LoggerFacade createLogger(String name) { 49 return new TxLogger(logger, name); 50 } 51 52 public void logInfo(String message) { 53 logger.log(message, logChannel, Logger.INFO); 54 } 55 56 public void logFine(String message) { 57 logger.log(message, logChannel, Logger.DEBUG); 58 } 59 60 public boolean isFineEnabled() { 61 return logger.isEnabled(logChannel, Logger.DEBUG); 62 } 63 64 public void logFiner(String message) { 65 logger.log(message, logChannel, Logger.DEBUG); 66 } 67 68 public boolean isFinerEnabled() { 69 return logger.isEnabled(logChannel, Logger.DEBUG); 70 } 71 72 public void logFinest(String message) { 73 logger.log(message, logChannel, Logger.DEBUG); 74 } 75 76 public boolean isFinestEnabled() { 77 return logger.isEnabled(logChannel, Logger.DEBUG); 78 } 79 80 public void logWarning(String message) { 81 logger.log(message, logChannel, Logger.WARNING); 82 } 83 84 public void logWarning(String message, Throwable t) { 85 logger.log(message, logChannel, Logger.WARNING); 86 logger.log(t, logChannel, Logger.WARNING); 87 } 88 89 public void logSevere(String message) { 90 logger.log(message, logChannel, Logger.EMERGENCY); 91 } 92 93 public void logSevere(String message, Throwable t) { 94 logger.log(message, logChannel, Logger.EMERGENCY); 95 logger.log(t, logChannel, Logger.EMERGENCY); 96 } 97 98 } | Popular Tags |