1448
|
1 package goodjava.logger;
|
|
2
|
|
3 import java.util.Map;
|
|
4 import java.util.HashMap;
|
|
5 import goodjava.logging.ILoggerFactory;
|
|
6 import goodjava.logging.Logger;
|
|
7
|
|
8
|
|
9 public class GoodLoggerFactory implements ILoggerFactory {
|
|
10 private final Map<String,GoodLogger> map = new HashMap<String,GoodLogger>();
|
|
11
|
|
12 @Override public synchronized Logger getLogger(String name) {
|
|
13 GoodLogger logger = map.get(name);
|
|
14 if( logger == null ) {
|
|
15 logger = new GoodLogger(name);
|
|
16 map.put(name,logger);
|
|
17 }
|
|
18 return logger;
|
|
19 }
|
|
20 }
|