1 33 34 package org.slf4j.impl; 35 36 import java.util.HashMap ; 37 import java.util.Map ; 38 39 import org.slf4j.Logger; 40 import org.slf4j.ILoggerFactory; 41 42 48 public class SimpleLoggerFactory implements ILoggerFactory { 49 50 final static SimpleLoggerFactory INSTANCE = new SimpleLoggerFactory(); 51 52 Map loggerMap; 53 54 public SimpleLoggerFactory() { 55 loggerMap = new HashMap (); 56 } 57 58 61 public Logger getLogger(String name) { 62 Logger slogger = null; 63 synchronized (this) { 65 slogger = (Logger) loggerMap.get(name); 66 if (slogger == null) { 67 slogger = new SimpleLogger(name); 68 loggerMap.put(name, slogger); 69 } 70 } 71 return slogger; 72 } 73 } 74 | Popular Tags |