34c943e5238f82830e0fc5afd50b80a6b1518b67
[mir.git] / Log.java
1 package mir.log;
2
3 import mir.misc.MirConfig;
4
5
6 public class Log {
7
8     private static Logger myLogger;
9
10     static {
11         try {
12             myLogger = (Logger)Class.forName(MirConfig.getProp("Log.LogClass")).newInstance();
13         }
14         catch (java.lang.ClassNotFoundException cnfe) {
15             System.err.println("Log was not able to initialize: class not found");
16             cnfe.printStackTrace(System.err);
17         }
18         catch (java.lang.InstantiationException ie) {
19             System.err.println("Log was not able to initialize: could not initialize class");
20             ie.printStackTrace(System.err);
21         }
22         catch (java.lang.IllegalAccessException iae) {
23             System.err.println("Log was not able to initialize: illegal access");
24             iae.printStackTrace(System.err);
25         }
26     }
27
28     public static void debug( Object o, String s) {
29         myLogger.debug( o, s );
30     }
31
32     public static void info( Object o, String s) {
33         myLogger.info( o, s );
34     }
35
36     public static void warn( Object o, String s) {
37         myLogger.warn( o, s );
38     }
39
40     public static void error( Object o, String s) {
41         myLogger.error( o, s );
42     }
43
44     public static void fatal( Object o, String s) {
45         myLogger.fatal( o, s );
46     }
47 }