
js.log4j.LogProviderImpl Maven / Gradle / Ivy
Show all versions of js-log4j Show documentation
package js.log4j;
import js.lang.Config;
import js.log.Log;
import js.log.LogContext;
import js.log.LogProvider;
/**
* Implementation for {@link LogProvider} interface. This implementation is rather simple: it is a factory for loggers
* and log contexts.
*
* Current implementation uses underlying log4j.properties
configuration; therefore {@link #config(Config)}
* is not used, that is, is empty.
*
* @author Iulian Rotaru
* @version final
*/
public final class LogProviderImpl implements LogProvider
{
/** Reusable log context instance. */
private LogContext logContext = new LogContextImpl();
/**
* Current implementation uses underlying log4j.properties
configuration and this method is NOP.
*
* @param config configuration object, not used.
*/
@Override
public void config(Config config)
{
}
@Override
public Log getLogger(String loggerName)
{
return new LogImpl(loggerName);
}
@Override
public LogContext getLogContext()
{
return logContext;
}
}