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, Throwable t);

Source Link

Document

Logs an error with debug log level.

Usage

From source file:com.amazonaws.client.util.sdk.IOUtils.java

/**
 * Closes the given Closeable quietly.//w ww .j  av a  2s . com
 * @param is the given closeable
 * @param log logger used to log any failure should the close fail
 */
public static void closeQuietly(Closeable is, Log log) {
    if (is != null) {
        try {
            is.close();
        } catch (IOException ex) {
            Log logger = log == null ? defaultLog : log;
            if (logger.isDebugEnabled())
                logger.debug("Ignore failure in closing the Closeable", ex);
        }
    }
}

From source file:com.amazonaws.util.IOUtils.java

/**
 * Closes the given Closeable quietly./*from   ww w  .ja va2s  .  co  m*/
 * @param is the given closeable
 * @param log logger used to log any failure should the close fail
 */
public static void closeQuietly(Closeable is, Log log) {
    if (is != null) {
        try {
            is.close();
        } catch (IOException ex) {
            if (log != null)
                log.debug("Ignore failure in closing the Closeable", ex);
        }
    }
}

From source file:com.buffalokiwi.api.APILog.java

/**
 * Log an error with debug log level./*w  w w. j a  v a2s .  co m*/
 *
 * @param log Log to write to
 * @param message log this message
 * @param t log this cause
 */
public static void debug(final Log log, final Throwable t, final Object... message) {
    if (log.isDebugEnabled())
        log.debug(concat(message), t);
}

From source file:net.gleamynode.netty2.SessionLog.java

public static void debug(Log log, Session session, Object obj, Throwable cause) {
    log.debug(getMessage(session, obj), cause);
}

From source file:com.datos.vfs.VfsLog.java

/**
 * debug.//  w w  w  .  jav a 2 s  .  c o m
 * @param vfslog The base component Logger to use.
 * @param commonslog The class specific Logger
 * @param message The message to log.
 * @param t The exception, if any.
 */
public static void debug(final Log vfslog, final Log commonslog, final String message, final Throwable t) {
    if (vfslog != null) {
        vfslog.debug(message, t);
    } else if (commonslog != null) {
        commonslog.debug(message, t);
    }
}

From source file:com.headissue.pigeon.util.LogUtils.java

public static void debug(Log log, Throwable t, String message, Object... args) {
    if (log.isDebugEnabled()) {
        if (args != null && args.length > 0) {
            message = String.format(message, args);
        }//  w  w w . jav  a  2  s  .c  o  m
        log.debug(message, t);
    }
}

From source file:es.tunelator.log.Logger.java

/**
 * @param source//from   w  ww.  j av  a  2  s . c  o  m
 * @param msg
 * @param e
 */
public static void logDebug(Class source, String msg, Throwable e) {
    Log log = LogFactory.getLog(es.tunelator.AppParameters.LOG_DEBUG);
    //        Log log = LogFactory.getLog(source);
    log.debug(msg, e);
}

From source file:com.intel.chimera.utils.IOUtils.java

/**
 * Closes the Closeable objects and <b>ignore</b> any {@link IOException} or
 * null pointers. Must only be used for cleanup in exception handlers.
 *
 * @param log the log to record problems to at debug level. Can be null.
 * @param closeables the objects to close.
 *///from   ww  w  .j a  va2s .  c om
public static void cleanup(Log log, java.io.Closeable... closeables) {
    for (java.io.Closeable c : closeables) {
        if (c != null) {
            try {
                c.close();
            } catch (Throwable e) {
                if (log != null && log.isDebugEnabled()) {
                    log.debug("Exception in closing " + c, e);
                }
            }
        }
    }
}

From source file:com.runwaysdk.logging.RunwayLogUtil.java

public static void logToLevel(Log log, LogLevel level, String msg, Throwable t) {
    if (level == LogLevel.TRACE) {
        log.trace(msg, t);//w w  w.ja v  a  2s  .com
    } else if (level == LogLevel.DEBUG) {
        log.debug(msg, t);
    } else if (level == LogLevel.INFO) {
        log.info(msg, t);
    } else if (level == LogLevel.WARN) {
        log.warn(msg, t);
    } else if (level == LogLevel.ERROR) {
        log.error(msg, t);
    } else if (level == LogLevel.FATAL) {
        log.fatal(msg, t);
    } else {
        log.fatal(
                "RunwayLogUtil.logToLevel was called, but an invalid level was specified. Here is the message we were passed: '"
                        + msg + "'");
    }
}

From source file:eu.stratosphere.nephele.util.IOUtils.java

/**
 * Close the Closeable objects and <b>ignore</b> any {@link IOException} or
 * null pointers. Must only be used for cleanup in exception handlers.
 * //ww w.j a v  a 2  s.  c  om
 * @param log
 *        the log to record problems to at debug level. Can be <code>null</code>.
 * @param closeables
 *        the objects to close
 */
public static void cleanup(final Log log, final java.io.Closeable... closeables) {
    for (java.io.Closeable c : closeables) {
        if (c != null) {
            try {
                c.close();
            } catch (IOException e) {
                if (log != null && log.isDebugEnabled()) {
                    log.debug("Exception in closing " + c, e);
                }
            }
        }
    }
}