1 33 34 package org.slf4j.impl; 35 36 import java.util.HashMap ; 37 import java.util.Map ; 38 39 import org.apache.commons.logging.LogFactory; 40 import org.slf4j.ILoggerFactory; 41 import org.slf4j.Logger; 42 43 49 public class JCLLoggerFactory implements ILoggerFactory { 50 51 Map loggerMap; 53 54 public JCLLoggerFactory() { 55 loggerMap = new HashMap (); 56 } 57 58 63 public Logger getLogger(String name) { 64 Logger logger = null; 65 synchronized (this) { 67 logger = (Logger) loggerMap.get(name); 68 if (logger == null) { 69 org.apache.commons.logging.Log jclLogger = LogFactory.getLog(name); 70 logger = new JCLLoggerAdapter(jclLogger, name); 71 loggerMap.put(name, logger); 72 } 73 } 74 return logger; 75 } 76 } 77 | Popular Tags |