comparison src/goodjava/logger/GoodLoggerFactory.java @ 1454:219f2b937f2b

remove log4j
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 08 Mar 2020 14:11:30 -0600
parents 28b1ddacfad3
children
comparison
equal deleted inserted replaced
1453:928be2a4d565 1454:219f2b937f2b
5 5
6 6
7 public final class GoodLoggerFactory { 7 public final class GoodLoggerFactory {
8 private GoodLoggerFactory() {} // never 8 private GoodLoggerFactory() {} // never
9 9
10 public static final Appender DEFAULT_APPENDER;
10 public static final Configurer DEFAULT_CONFIGURER; 11 public static final Configurer DEFAULT_CONFIGURER;
11 static { 12 static {
12 Layout layout = new ListLayout(Layouts.LEVEL," - ",Layouts.MESSAGE,"\n",Layouts.THROWABLE); 13 Layout layout = new ListLayout(Layouts.LEVEL," - ",Layouts.MESSAGE,"\n",Layouts.THROWABLE);
13 Appender appender = new ConsoleAppender(layout,System.err); 14 DEFAULT_APPENDER = new ConsoleAppender(layout,System.err);
14 DEFAULT_CONFIGURER = new SimpleConfigurer(Level.INFO,appender); 15 DEFAULT_CONFIGURER = new SimpleConfigurer(Level.INFO,DEFAULT_APPENDER);
15 } 16 }
16 private static final Map<String,GoodLogger> map = new HashMap<String,GoodLogger>(); 17 private static final Map<String,GoodLogger> map = new HashMap<String,GoodLogger>();
17 private static Configurer configurer = DEFAULT_CONFIGURER; 18 private static Configurer configurer = DEFAULT_CONFIGURER;
18 19
19 public static synchronized GoodLogger getLogger(String name) { 20 public static synchronized GoodLogger getLogger(String name) {