1 17 18 package org.apache.geronimo.kernel.log; 19 20 import org.apache.commons.logging.Log; 21 22 28 public final class GeronimoLog implements Log { 29 private final String name; 30 private Log log; 31 32 public GeronimoLog(String name, Log log) { 33 this.name = name; 34 this.log = log; 35 } 36 37 public String getName() { 38 return name; 39 } 40 41 public Log getLog() { 42 return log; 43 } 44 45 public void setLog(Log log) { 46 this.log = log; 47 } 48 49 public boolean isTraceEnabled() { 50 return log.isTraceEnabled(); 51 } 52 53 public void trace(Object message) { 54 log.trace(message); 55 } 56 57 public void trace(Object message, Throwable throwable) { 58 log.trace(message, throwable); 59 } 60 61 public boolean isDebugEnabled() { 62 return log.isDebugEnabled(); 63 } 64 65 public void debug(Object message) { 66 log.debug(message); 67 } 68 69 public void debug(Object message, Throwable throwable) { 70 log.debug(message, throwable); 71 } 72 73 public boolean isInfoEnabled() { 74 return log.isInfoEnabled(); 75 } 76 77 public void info(Object message) { 78 if(!name.startsWith("/")) { log.info(message); 80 } 81 } 82 83 public void info(Object message, Throwable throwable) { 84 log.info(message, throwable); 85 } 86 87 public boolean isWarnEnabled() { 88 return log.isWarnEnabled(); 89 } 90 91 public void warn(Object message) { 92 log.warn(message); 93 } 94 95 public void warn(Object message, Throwable throwable) { 96 log.warn(message, throwable); 97 } 98 99 public boolean isErrorEnabled() { 100 return log.isErrorEnabled(); 101 } 102 103 public void error(Object message) { 104 log.error(message); 105 } 106 107 public void error(Object message, Throwable throwable) { 108 log.error(message, throwable); 109 } 110 111 public boolean isFatalEnabled() { 112 return log.isFatalEnabled(); 113 } 114 115 public void fatal(Object message) { 116 log.fatal(message); 117 } 118 119 public void fatal(Object message, Throwable throwable) { 120 log.fatal(message, throwable); 121 } 122 } 123 | Popular Tags |