view 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
line wrap: on
line source

package goodjava.logger;

import java.util.Map;
import java.util.HashMap;
import goodjava.logging.ILoggerFactory;
import goodjava.logging.Logger;


public class GoodLoggerFactory implements ILoggerFactory {
	private final Map<String,GoodLogger> map = new HashMap<String,GoodLogger>();

	@Override public synchronized Logger getLogger(String name) {
		GoodLogger logger = map.get(name);
		if( logger == null ) {
			logger = new GoodLogger(name);
			map.put(name,logger);
		}
		return logger;
	}
}