comparison src/goodjava/logger/GoodLoggerFactory.java @ 1448:6fc083e1d08c

start logger
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 23 Feb 2020 18:14:32 -0700
parents
children 28b1ddacfad3
comparison
equal deleted inserted replaced
1447:851b9a48cc44 1448:6fc083e1d08c
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 }