Mercurial Hosting > luan
annotate src/goodjava/logging/LoggerFactory.java @ 1474:13cbce740e1e
LowercaseAnalyzer
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 17 Apr 2020 21:53:09 -0600 |
parents | 219f2b937f2b |
children |
rev | line source |
---|---|
1402
27efb1fcbcb5
move luan.lib to goodjava
Franklin Schmidt <fschmidt@gmail.com>
parents:
1338
diff
changeset
|
1 package goodjava.logging; |
1337 | 2 |
3 | |
1448 | 4 public final class LoggerFactory { |
5 public static final ILoggerFactory implementation; | |
6 static { | |
1454 | 7 String s = System.getProperty("goodjava.logger","goodjava.logger.LoggingFactory"); |
1448 | 8 try { |
9 implementation = (ILoggerFactory)Class.forName(s).newInstance(); | |
10 } catch(ClassNotFoundException e) { | |
11 throw new RuntimeException(e); | |
12 } catch(InstantiationException e) { | |
13 throw new RuntimeException(e); | |
14 } catch(IllegalAccessException e) { | |
15 throw new RuntimeException(e); | |
16 } | |
1337 | 17 } |
18 | |
19 public static Logger getLogger(String name) { | |
1448 | 20 return implementation.getLogger(name); |
21 } | |
22 | |
23 public static Logger getLogger(Class cls) { | |
24 return getLogger(cls.getName()); | |
1337 | 25 } |
26 } |