1 27 28 package org.objectweb.speedo.log; 29 30 import org.objectweb.util.monolog.api.LoggerFactory; 31 import org.objectweb.util.monolog.api.Logger; 32 import org.objectweb.util.monolog.Monolog; 33 34 39 public class Log 40 implements LoggerFactory, LogAttributes { 41 42 45 public final static String DEFAULT_LOGGER_FACTORY = 46 "org.objectweb.util.monolog.wrapper.printwriter.LoggerImpl"; 47 48 private static LoggerFactory lastLF = null; 49 50 public static LoggerFactory getLoggerFactory() { 51 if (lastLF == null) { 52 lastLF = Monolog.initialize(); 53 } 54 return lastLF; 55 } 56 57 private LoggerFactory delegate = null; 58 private String pfn = null; 59 60 63 public String getPropertiesFileName() { 64 return pfn; 65 } 66 67 public void setPropertiesFileName(String propfn) { 68 if (pfn != null && pfn.equals(propfn)) 69 return; 70 pfn = propfn; 71 delegate = Monolog.getMonologFactory(propfn); 72 lastLF = this; 73 } 74 75 78 public Logger getLogger(String s) { 79 return delegate.getLogger(s); 80 } 81 82 public Logger getLogger(String s, String s1) { 83 return delegate.getLogger(s1); 84 } 85 86 public String getResourceBundleName() { 87 return delegate.getResourceBundleName(); 88 } 89 90 public void setResourceBundleName(String s) { 91 delegate.setResourceBundleName(s); 92 } 93 94 public Logger[] getLoggers() { 95 return delegate.getLoggers(); 96 } 97 } 98 | Popular Tags |