view src/goodjava/logger/GoodLoggerFactory.java @ 1449:dd14d2dce7ee

add appenders
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 28 Feb 2020 21:14:23 -0700
parents 6fc083e1d08c
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;
	}
}