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

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

Introduction

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

Prototype

void debug(Object message);

Source Link

Document

Logs a message with debug log level.

Usage

From source file:jatoo.log4j.Log4jUtilsTest.java

@Test
public void testOneLogger() {

    Log4jUtils.init(WORKING_DIRECTORY);/*from  w  w  w  .j ava 2 s .  c om*/

    Log logger = LogFactory.getLog(Log4jUtilsTest.class);

    logger.debug("debug");
    logger.info("info");
    logger.warn("warn");
    logger.error("error");
    logger.fatal("fatal");
}

From source file:jatoo.log4j.Log4jUtilsTest.java

@Test
public void testManyLoggers() {

    Log4jUtils.init(WORKING_DIRECTORY);//from   w ww  .  j a v  a  2 s  .  c o m

    //
    // logger 1

    Log logger1 = LogFactory.getLog("logger1");

    logger1.debug("debug");
    logger1.info("info");
    logger1.warn("warn");
    logger1.error("error");
    logger1.fatal("fatal");

    //
    // logger 2

    Log logger2 = LogFactory.getLog("logger2");

    logger2.debug("debug");
    logger2.info("info");
    logger2.warn("warn");
    logger2.error("error");
    logger2.fatal("fatal");
}

From source file:hadoopInstaller.logging.CompositeLog.java

@Override
public void debug(Object message) {
    for (Log log : this.logs) {
        log.debug(message);
    }
}

From source file:edu.cornell.med.icb.goby.util.WarningCounter.java

public void debug(org.apache.commons.logging.Log log, String format, Object... option) {
    if (log.isDebugEnabled() && warnAgain()) {
        log.debug(String.format(format, option));
    }//from   ww w  . j a  v a2s .c o m
}

From source file:edu.cornell.med.icb.goby.util.WarningCounter.java

public void trace(org.apache.commons.logging.Log log, String format, Object... option) {
    if (log.isTraceEnabled() && warnAgain()) {
        log.debug(String.format(format, option));
    }/*from w  w w. ja  va2 s.com*/
}

From source file:edu.vt.middleware.crypt.CryptProvider.java

/**
 * <p>This finds a <code>Cipher</code> using the known providers and the
 * supplied parameters.</p>//w  w w  .  j  av  a 2 s  .c o m
 *
 * @param  algorithm  <code>String</code> name
 * @param  mode  <code>String</code> name
 * @param  padding  <code>String</code> name
 *
 * @return  <code>Cipher</code>
 *
 * @throws  CryptException  if the algorithm is not available from any
 * provider or if the provider is not available in the environment
 */
public static Cipher getCipher(final String algorithm, final String mode, final String padding)
        throws CryptException {
    final Log logger = LogFactory.getLog(CryptProvider.class);
    Cipher cipher = null;
    String transformation = null;
    if (mode != null && padding != null) {
        transformation = algorithm + "/" + mode + "/" + padding;
    } else if (mode != null) {
        transformation = algorithm + "/" + mode;
    } else {
        transformation = algorithm;
    }
    for (int i = 0; i < providers.length; i++) {
        try {
            cipher = Cipher.getInstance(transformation, providers[i]);
        } catch (NoSuchAlgorithmException e) {
            if (logger.isDebugEnabled()) {
                logger.debug("Could not find algorithm " + algorithm + " in " + providers[i]);
            }
        } catch (NoSuchProviderException e) {
            if (logger.isDebugEnabled()) {
                logger.debug("Could not find provider " + providers[i]);
            }
        } catch (NoSuchPaddingException e) {
            if (logger.isDebugEnabled()) {
                logger.debug("Could not find padding " + padding + " in " + providers[i]);
            }
        } finally {
            if (cipher != null) {
                break;
            }
        }
    }
    if (cipher == null) {
        try {
            cipher = Cipher.getInstance(transformation);
        } catch (NoSuchAlgorithmException e) {
            if (logger.isDebugEnabled()) {
                logger.debug("Could not find algorithm " + algorithm);
            }
            throw new CryptException(e.getMessage());
        } catch (NoSuchPaddingException e) {
            if (logger.isDebugEnabled()) {
                logger.debug("Could not find padding " + padding);
            }
            throw new CryptException(e.getMessage());
        }
    }
    return cipher;
}

From source file:com.siblinks.ws.common.BaseException.java

public void log(final Log log) {
    if (errorLevel.equals(ErrorLevel.INFO) && log.isDebugEnabled()) {
        log.debug("Info Message: ID - " + uniqueID + " User Message: " + userMessageKey);
        log.debug(StackTracer.getStackTrace(throwable));
    } else if (errorLevel.equals(ErrorLevel.WARNING) && log.isWarnEnabled()) {
        log.warn("Warn Message: ID - " + uniqueID + " User Message: " + userMessageKey);
        log.warn(StackTracer.getStackTrace(throwable));
    } else if (errorLevel.equals(ErrorLevel.ERROR) && log.isErrorEnabled()) {
        log.error("Error Message: ID - " + uniqueID + " User Message: " + userMessageKey);
        log.error(StackTracer.getStackTrace(throwable));
    } else if (errorLevel.equals(ErrorLevel.FATAL) && log.isFatalEnabled()) {
        log.fatal("Fatal Message: ID - " + uniqueID + " User Message: " + userMessageKey);
        log.fatal(StackTracer.getStackTrace(throwable));
    }/*from w ww.j ava  2 s .  co  m*/
    logged = true;
}

From source file:com.lucidtechnics.blackboard.util.error.ErrorManager.java

public void throwException(Throwable _t, Log _logger) {
    logException(_t, _logger);/*from   w ww. ja v a2  s . c  o m*/

    if (_logger.isDebugEnabled() == true) {
        _logger.debug("ErrorManager Found this exception: " + _t.getClass());
    }

    if ((_t instanceof BlackboardException) == true) {
        throw (BlackboardException) _t;
    } else {
        throw new BlackboardException(_t);
    }
}

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

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

    mock.debug("a");
    replay(mock);/*from   ww  w  .j  a va  2 s .c o m*/

    InternalLogger logger = new CommonsLogger(mock, "foo");
    logger.debug("a");
    verify(mock);
}

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

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

    mock.debug("a");
    replay(mock);/*from  w ww.j  av  a  2 s . c  o m*/

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