Example usage for org.apache.commons.logging Log isInfoEnabled

List of usage examples for org.apache.commons.logging Log isInfoEnabled

Introduction

In this page you can find the example usage for org.apache.commons.logging Log isInfoEnabled.

Prototype

boolean isInfoEnabled();

Source Link

Document

Is info logging currently enabled?

Usage

From source file:net.mikaboshi.intra_mart.tools.log_stats.parser.GenericLogParser.java

/**
 * INFO??//from ww w .  j  av a  2s .  c o m
 * @param format
 * @param args
 */
protected void info(String format, Object... args) {

    Log logger = getLogger();

    if (logger.isInfoEnabled()) {
        logger.info(String.format("[" + getLogFilePath() + "] " + format, args));
    }
}

From source file:com.netspective.axiom.sql.QueryExecutionLogEntry.java

public void finalize(ValueContext vc, Log log) {
    if (!log.isInfoEnabled())
        return;/*from w w w  .  j  a  v a 2  s.c  o  m*/

    StringBuffer info = new StringBuffer();
    info.append(identifier);
    info.append(FIELD_SEPARATOR);
    info.append(successful ? 1 : 0);
    info.append(FIELD_SEPARATOR);
    if (successful) {
        info.append(getConnEndTime - getConnStartTime);
        info.append(FIELD_SEPARATOR);
        info.append(bindParamsEndTime - bindParamsStartTime);
        info.append(FIELD_SEPARATOR);
        info.append(execSqlEndTime - execSqlStartTime);
        info.append(FIELD_SEPARATOR);
        info.append(execSqlEndTime - initTime);
        info.append(FIELD_SEPARATOR);
    } else {
        info.append(-1);
        info.append(FIELD_SEPARATOR);
        info.append(-1);
        info.append(FIELD_SEPARATOR);
        info.append(-1);
        info.append(FIELD_SEPARATOR);
        info.append(-1);
        info.append(FIELD_SEPARATOR);
    }
    info.append(source);

    log.info(info.toString());
}

From source file:com.liulangf.pattern.gof.behavioral.chain.jakarta.simple.ExampleServlet.java

/**
 * <p>Cache the name of the servlet.</p>
 *
 * @exception ServletException if an initialization error occurs
 */// w  w  w . j  av  a 2s  .  c o m
public void init() throws ServletException {
    super.init();
    Log log = LogFactory.getLog(ExampleServlet.class);
    servletName = getServletConfig().getServletName();
    if (log.isInfoEnabled()) {
        log.info("Initializing chain example servlet '" + servletName + "'");
    }
}

From source file:com.CodeSeance.JSeance.CodeGenXML.Context.java

public void LogInfoMessage(Log log, String tagName, String message) {
    if (log.isInfoEnabled()) {
        log.info(String.format("%s<%s> - %s", logSpacing, tagName, message));
    }/*from  ww w  .j a va 2 s . com*/
}

From source file:net.sf.nmedit.jtheme.JTContext.java

public void setUIDefaultsClassLoader(ClassLoader loader) {
    Log log = getLogger();
    if (log.isInfoEnabled()) {
        Class<?> loaderClass = loader == null ? null : loader.getClass();

        log.info("Setting UIDefaults ClassLoader in " + this + ": " + loader + " (" + loaderClass + ")");
    }//w ww  .java 2 s  . c om

    getUIDefaults().put(UIDefaultsClassLoaderKey, loader);
}

From source file:hadoopInstaller.logging.CompositeLog.java

@Override
public boolean isInfoEnabled() {
    boolean enabled = true;
    for (Log log : this.logs) {
        enabled = enabled && log.isInfoEnabled();
    }//from ww  w.ja  va 2 s  .c  o m
    return enabled;
}

From source file:io.netty.logging.CommonsLoggerTest.java

@Test
public void testIsInfoEnabled() {
    Log mock = createStrictMock(Log.class);

    expect(mock.isInfoEnabled()).andReturn(true);
    replay(mock);/*from  w w  w.ja va2  s .c om*/

    InternalLogger logger = new CommonsLogger(mock, "foo");
    assertTrue(logger.isInfoEnabled());
    verify(mock);
}

From source file:fr.gouv.vitam.utils.logging.CommonsLoggerTest.java

@Test
public void testIsInfoEnabled() {
    final Log mock = createStrictMock(Log.class);

    expect(mock.isInfoEnabled()).andReturn(true);
    replay(mock);//  w  w  w  . java  2  s .c o m

    final VitamLogger logger = new CommonsLogger(mock, "foo");
    assertTrue(logger.isInfoEnabled());
    verify(mock);
}

From source file:fr.gouv.vitam.utils.logging.CommonsLoggerFactory.java

@Override
protected VitamLogLevel getLevelSpecific() {
    final Log logger = LogFactory.getFactory().getInstance("foo");
    if (logger.isTraceEnabled()) {
        return VitamLogLevel.TRACE;
    } else if (logger.isDebugEnabled()) {
        return VitamLogLevel.DEBUG;
    } else if (logger.isInfoEnabled()) {
        return VitamLogLevel.INFO;
    } else if (logger.isWarnEnabled()) {
        return VitamLogLevel.WARN;
    } else if (logger.isErrorEnabled()) {
        return VitamLogLevel.ERROR;
    }/*from   w w  w  . ja v  a  2 s.co m*/
    return null;
}

From source file:net.mikaboshi.intra_mart.tools.log_stats.parser.LineLogParser.java

/**
 * INFO??/* ww w .j  a  v  a  2  s .  c  o m*/
 */
@Override
protected void info(String format, Object... args) {

    Log logger = getLogger();

    if (logger.isInfoEnabled()) {
        logger.info(String.format("[" + getLogFilePath() + "#" + this.nLine + "] " + format, args));
    }
}