/** * Convenience method to return a named logger, without the application * having to care about factories. * * @param clazz Class from which a log name will be derived * @throws LogConfigurationException if a suitable <code>Log</code> * instance cannot be returned */ public static Log getLog(Class clazz) throws LogConfigurationException { return getFactory().getInstance(clazz); }
/** * Convenience method to return a named logger, without the application * having to care about factories. * * @param name Logical name of the <code>Log</code> instance to be * returned (the meaning of this name is only known to the underlying * logging implementation that is being wrapped) * @throws LogConfigurationException if a suitable <code>Log</code> * instance cannot be returned */ public static Log getLog(String name) throws LogConfigurationException { return getFactory().getInstance(name); }
/** * Convenience method to return a named logger, without the application having * to care about factories. * * @param clazz * Class from which a log name will be derived * * @exception LogConfigurationException * if a suitable <code>Log</code> instance cannot be * returned */ public static Log getLog(Class clazz) throws LogConfigurationException { return (getFactory().getInstance(clazz)); }
/** * Convenience method to return a named logger, without the application having * to care about factories. * * @param name * Logical name of the <code>Log</code> instance to be * returned (the meaning of this name is only known to the * underlying logging implementation that is being wrapped) * * @exception LogConfigurationException * if a suitable <code>Log</code> instance cannot be * returned */ public static Log getLog(String name) throws LogConfigurationException { return (getFactory().getInstance(name)); }
/** * Convenience method to return a named logger, without the application having * to care about factories. * * @param clazz * Class from which a log name will be derived * * @exception LogConfigurationException * if a suitable <code>Log</code> instance cannot be * returned */ public static Log getLog(Class clazz) throws LogConfigurationException { return (getFactory().getInstance(clazz)); }
/** * Convenience method to return a named logger, without the application having * to care about factories. * * @param name * Logical name of the <code>Log</code> instance to be * returned (the meaning of this name is only known to the * underlying logging implementation that is being wrapped) * * @exception LogConfigurationException * if a suitable <code>Log</code> instance cannot be * returned */ public static Log getLog(String name) throws LogConfigurationException { return (getFactory().getInstance(name)); }
/** * Convenience method to return a named logger, without the application * having to care about factories. * * @param clazz Class from which a log name will be derived * * @exception LogConfigurationException if a suitable <code>Log</code> * instance cannot be returned */ public static Log getLog(Class clazz) throws LogConfigurationException { return (getFactory().getInstance(clazz)); }
/** * Convenience method to return a named logger, without the application * having to care about factories. * * @param name Logical name of the <code>Log</code> instance to be * returned (the meaning of this name is only known to the underlying * logging implementation that is being wrapped) * * @exception LogConfigurationException if a suitable <code>Log</code> * instance cannot be returned */ public static Log getLog(String name) throws LogConfigurationException { return (getFactory().getInstance(name)); }
/** * Install our custom logger by setting the factory attribute */ private Object configureFactory() { Object oldValue = org.apache.commons.logging.LogFactory.getFactory().getAttribute("org.apache.commons.logging.Log"); org.apache.commons.logging.LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", logImpl); return oldValue; }
/** * Convenience method to return a named logger, without the application having * to care about factories. * * @param clazz Class from which a log name will be derived * @throws LogConfigurationException if a suitable <code>Log</code> instance cannot be * returned */ public static Log getLog(Class clazz) throws LogConfigurationException { return (getFactory().getInstance(clazz)); }
/** * Convenience method to return a named logger, without the application * having to care about factories. * * @param clazz Class from which a log name will be derived * @throws LogConfigurationException if a suitable <code>Log</code> * instance cannot be returned */ public static Log getLog(Class clazz) throws LogConfigurationException { return getFactory().getInstance(clazz); }
/** * Make HtmlUnit's logger shut up for good. */ public static void silenceHtmlUnitLogging() { LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog"); java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF); java.util.logging.Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.OFF); }
/** * Convenience method to return a named logger, without the application * having to care about factories. * * @param clazz Class from which a log name will be derived * * @throws LogConfigurationException if a suitable <code>Log</code> * instance cannot be returned */ public static Log getLog(Class clazz) throws LogConfigurationException { return getFactory().getInstance(clazz); }
/** * Release any internal references to previously created {@link LogFactory} * instances, after calling the instance method <code>release()</code> on * each of them. This is useful in environments like servlet containers, * which implement application reloading by throwing away a ClassLoader. * Dangling references to objects in that class loader would prevent * garbage collection. */ public static void releaseAll() { getFactory().release(); }
/** * Release any internal references to previously created {@link org.apache.commons.logging.LogFactory} * instances that have been associated with the specified class loader * (if any), after calling the instance method <code>release()</code> on * each of them. * * @param classLoader ClassLoader for which to release the LogFactory */ public static void release(ClassLoader classLoader) { getFactory().release(); }
/** * Creates an instance of the LogFactoryMock and sets the system property LogFactory looks at to find the correct LogFactory to return when a factory is requested and releases all instances to make * sure that a LogFactoryMock is returned. * * @return An instance of LogFactoryMock. */ public static LogFactoryMock createInstance() { LogFactoryMock.resetInstance(); System.setProperty("org.apache.commons.logging.LogFactory", "se.vgregion.kivtools.mocks.LogFactoryMock"); LogFactory.releaseAll(); return (LogFactoryMock) LogFactory.getFactory(); }
@Override protected void setUp() throws Exception { super.setUp(); LogFactory.getFactory().release(); LogManager.resetConfiguration(); }
@Override protected void tearDown() throws Exception { LogFactory.getFactory().release(); LogManager.resetConfiguration(); super.tearDown(); }
@Override protected void tearDown() throws Exception { LogFactory.getFactory().release(); LogManager.resetConfiguration(); super.tearDown(); }
@Override protected void setUp() throws Exception { super.setUp(); LogFactory.getFactory().release(); LogManager.resetConfiguration(); }