1 52 53 package freemarker.log; 54 55 import java.util.logging.Level ; 56 57 61 class JDK14LoggerFactory implements LoggerFactory 62 { 63 public Logger getLogger(String category) 64 { 65 return new JDK14Logger(java.util.logging.Logger.getLogger(category)); 66 } 67 68 private static class JDK14Logger 69 extends 70 Logger 71 { 72 private final java.util.logging.Logger logger; 73 74 JDK14Logger(java.util.logging.Logger logger) 75 { 76 this.logger = logger; 77 } 78 79 public void debug(String message) 80 { 81 logger.log(Level.FINE, message); 82 } 83 84 public void debug(String message, Throwable t) 85 { 86 logger.log(Level.FINE, message, t); 87 } 88 89 public void error(String message) 90 { 91 logger.log(Level.SEVERE, message); 92 } 93 94 public void error(String message, Throwable t) 95 { 96 logger.log(Level.SEVERE, message, t); 97 } 98 99 public void info(String message) 100 { 101 logger.log(Level.INFO, message); 102 } 103 104 public void info(String message, Throwable t) 105 { 106 logger.log(Level.INFO, message, t); 107 } 108 109 public void warn(String message) 110 { 111 logger.log(Level.WARNING, message); 112 } 113 114 public void warn(String message, Throwable t) 115 { 116 logger.log(Level.WARNING, message, t); 117 } 118 119 public boolean isDebugEnabled() 120 { 121 return logger.isLoggable(Level.FINE); 122 } 123 124 public boolean isInfoEnabled() 125 { 126 return logger.isLoggable(Level.INFO); 127 } 128 129 public boolean isWarnEnabled() 130 { 131 return logger.isLoggable(Level.WARNING); 132 } 133 134 public boolean isErrorEnabled() 135 { 136 return logger.isLoggable(Level.SEVERE); 137 } 138 139 public boolean isFatalEnabled() 140 { 141 return logger.isLoggable(Level.SEVERE); 142 } 143 } 144 } 145 | Popular Tags |