1 33 34 package org.slf4j.impl; 35 36 import org.slf4j.Logger; 37 import org.slf4j.ILoggerFactory; 38 39 import java.util.HashMap ; 40 import java.util.Map ; 41 42 48 public class JDK14LoggerFactory implements ILoggerFactory { 49 50 Map loggerMap; 52 53 public JDK14LoggerFactory() { 54 loggerMap = new HashMap (); 55 } 56 57 62 public synchronized Logger getLogger(String name) { 63 Logger ulogger = null; 64 synchronized (this) { 66 if(name.equalsIgnoreCase(Logger.ROOT_LOGGER_NAME)) { 68 name = ""; 69 } 70 ulogger = (Logger) loggerMap.get(name); 71 if (ulogger == null) { 72 java.util.logging.Logger logger = java.util.logging.Logger 73 .getLogger(name); 74 ulogger = new JDK14LoggerAdapter(logger); 75 loggerMap.put(name, ulogger); 76 } 77 } 78 return ulogger; 79 } 80 } 81 | Popular Tags |