3 import org.apache.log4j.PropertyConfigurator;
4 import org.apache.log4j.Logger;
7 import java.util.HashMap;
9 import mir.misc.MirConfig;
12 public class LoggerImpl implements mir.log.Logger {
14 private static Map loggers = new HashMap();
17 System.setProperty("log.home", MirConfig.getPropWithHome("Log.Home"));
18 PropertyConfigurator.configure(MirConfig.getPropWithHome("Log.log4j.ConfigurationFile").trim());
22 public void debug( Object o, String s ) {
23 this.getLogger(o).debug(s);
26 public void info( Object o, String s ) {
27 this.getLogger(o).info(s);
30 public void warn( Object o, String s ) {
31 this.getLogger(o).warn(s);
34 public void error( Object o, String s ) {
35 this.getLogger(o).error(s);
38 public void fatal( Object o, String s ) {
39 this.getLogger(o).fatal(s);
43 private Logger getLogger( Object o ) {
46 if (o instanceof String) {
48 } else if (o instanceof Class) {
49 name = ((Class)o).getName();
51 name = o.getClass().getName();
56 Logger l = (Logger)loggers.get(name);
58 l = Logger.getLogger(name);