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:org.qedeq.base.trace.Trace.java

/**
 * Trace parameter.//ww  w  .  ja  va 2  s .  c  om
 *
 * @param   tracingClass    Class that wants to make a trace entry.
 * @param   tracingObject   Instance that wants to make a trace entry.
 * @param   method          Method of that object.
 * @param   param           Parameter to trace.
 * @param   value           Value of parameter.
 */
public static void param(final Class tracingClass, final Object tracingObject, final String method,
        final String param, final Object value) {
    if (traceOn) {
        final Log log = LogFactory.getFactory().getInstance(tracingClass);
        if (log.isDebugEnabled()) {
            log.debug("." + method + " " + param + "=" + value);
        }
    }
}

From source file:org.qedeq.base.trace.Trace.java

/**
 * Trace parameter./*from   w w w.j a v a2 s . c om*/
 *
 * @param   tracingClass    Class that wants to make a trace entry.
 * @param   method          Method of that class.
 * @param   param           Parameter to trace.
 * @param   value           Value of parameter.
 */
public static void param(final Class tracingClass, final String method, final String param,
        final Object value) {
    if (traceOn) {
        final Log log = LogFactory.getFactory().getInstance(tracingClass);
        if (log.isDebugEnabled()) {
            log.debug("." + method + " " + param + "=" + value);
        }
    }
}

From source file:org.qedeq.base.trace.Trace.java

/**
 * Trace parameter./*from w  ww  .  j a v a2s.c o  m*/
 *
 * @param   tracingClass    Class that wants to make a trace entry.
 * @param   tracingObject   Instance that wants to make a trace entry.
 * @param   method          Method of that object.
 * @param   param           Parameter to trace.
 * @param   value           Value of parameter.
 */
public static void param(final Class tracingClass, final Object tracingObject, final String method,
        final String param, final int value) {
    if (traceOn) {
        final Log log = LogFactory.getFactory().getInstance(tracingClass);
        if (log.isDebugEnabled()) {
            log.debug("." + method + " " + param + "=" + value);
        }
    }
}

From source file:org.qedeq.base.trace.Trace.java

/**
 * Trace parameter.// ww w .  j  a v  a  2 s .  c  o m
 *
 * @param   tracingClass    Class that wants to make a trace entry.
 * @param   method          Method of that class.
 * @param   param           Parameter to trace.
 * @param   value           Value of parameter.
 */
public static void param(final Class tracingClass, final String method, final String param, final int value) {
    if (traceOn) {
        final Log log = LogFactory.getFactory().getInstance(tracingClass);
        if (log.isDebugEnabled()) {
            log.debug("." + method + " " + param + "=" + value);
        }
    }
}

From source file:org.qedeq.base.trace.Trace.java

/**
 * Trace parameter./* ww w .  java2s .  c om*/
 *
 * @param   tracingClass    Class that wants to make a trace entry.
 * @param   tracingObject   Instance that wants to make a trace entry.
 * @param   method          Method of that object.
 * @param   param           Parameter to trace.
 * @param   value           Value of parameter.
 */
public static void param(final Class tracingClass, final Object tracingObject, final String method,
        final String param, final boolean value) {
    if (traceOn) {
        final Log log = LogFactory.getFactory().getInstance(tracingClass);
        if (log.isDebugEnabled()) {
            log.debug("." + method + " " + param + "=" + value);
        }
    }
}

From source file:org.qedeq.base.trace.Trace.java

/**
 * Trace parameter.//  ww  w.j  ava2 s . c o m
 *
 * @param   tracingClass    Class that wants to make a trace entry.
 * @param   method          Method of that class.
 * @param   param           Parameter to trace.
 * @param   value           Value of parameter.
 */
public static void param(final Class tracingClass, final String method, final String param,
        final boolean value) {
    if (traceOn) {
        final Log log = LogFactory.getFactory().getInstance(tracingClass);
        if (log.isDebugEnabled()) {
            log.debug("." + method + " " + param + "=" + value);
        }
    }
}

From source file:org.quartz.impl.jdbcjobstore.DBSemaphore.java

/**
 * Grants a lock on the identified resource to the calling thread (blocking
 * until it is available)./*from ww  w . j a  va  2  s.com*/
 * 
 * @return true if the lock was obtained.
 */
public boolean obtainLock(Connection conn, String lockName) throws LockException {

    lockName = lockName.intern();

    Log log = getLog();

    if (log.isDebugEnabled()) {
        log.debug("Lock '" + lockName + "' is desired by: " + Thread.currentThread().getName());
    }
    if (!isLockOwner(conn, lockName)) {

        executeSQL(conn, lockName, expandedSQL);

        if (log.isDebugEnabled()) {
            log.debug("Lock '" + lockName + "' given to: " + Thread.currentThread().getName());
        }
        getThreadLocks().add(lockName);
        //getThreadLocksObtainer().put(lockName, new
        // Exception("Obtainer..."));
    } else if (log.isDebugEnabled()) {
        log.debug("Lock '" + lockName + "' Is already owned by: " + Thread.currentThread().getName());
    }

    return true;
}

From source file:org.quartz.impl.jdbcjobstore.JTANonClusteredSemaphore.java

/**
 * Grants a lock on the identified resource to the calling thread (blocking
 * until it is available).// w  ww .j a  v  a2 s  . com
 * 
 * @return true if the lock was obtained.
 */
public synchronized boolean obtainLock(Connection conn, String lockName) throws LockException {

    lockName = lockName.intern();

    Log log = getLog();

    if (log.isDebugEnabled()) {
        log.debug("Lock '" + lockName + "' is desired by: " + Thread.currentThread().getName());
    }

    if (!isLockOwner(conn, lockName)) {
        if (log.isDebugEnabled()) {
            log.debug("Lock '" + lockName + "' is being obtained: " + Thread.currentThread().getName());
        }

        while (locks.contains(lockName)) {
            try {
                this.wait();
            } catch (InterruptedException ie) {
                if (log.isDebugEnabled()) {
                    log.debug(
                            "Lock '" + lockName + "' was not obtained by: " + Thread.currentThread().getName());
                }
            }
        }

        // If we are in a transaction, register a callback to actually release
        // the lock when the transaction completes
        Transaction t = getTransaction();
        if (t != null) {
            try {
                t.registerSynchronization(new SemaphoreSynchronization(lockName));
            } catch (Exception e) {
                throw new LockException("Failed to register semaphore with Transaction.", e);
            }
        }

        if (log.isDebugEnabled()) {
            log.debug("Lock '" + lockName + "' given to: " + Thread.currentThread().getName());
        }

        getThreadLocks().add(lockName);
        locks.add(lockName);
    } else if (log.isDebugEnabled()) {
        log.debug("Lock '" + lockName + "' already owned by: " + Thread.currentThread().getName()
                + " -- but not owner!", new Exception("stack-trace of wrongful returner"));
    }

    return true;
}

From source file:org.quartz.impl.jdbcjobstore.SimpleSemaphore.java

/**
 * Grants a lock on the identified resource to the calling thread (blocking
 * until it is available).//  w  w w .  ja va2 s.c om
 * 
 * @return true if the lock was obtained.
 */
public synchronized boolean obtainLock(Connection conn, String lockName) {

    lockName = lockName.intern();

    Log log = getLog();

    if (log.isDebugEnabled()) {
        log.debug("Lock '" + lockName + "' is desired by: " + Thread.currentThread().getName());
    }

    if (!isLockOwner(conn, lockName)) {
        if (log.isDebugEnabled()) {
            log.debug("Lock '" + lockName + "' is being obtained: " + Thread.currentThread().getName());
        }
        while (locks.contains(lockName)) {
            try {
                this.wait();
            } catch (InterruptedException ie) {
                if (log.isDebugEnabled()) {
                    log.debug(
                            "Lock '" + lockName + "' was not obtained by: " + Thread.currentThread().getName());
                }
            }
        }

        if (log.isDebugEnabled()) {
            log.debug("Lock '" + lockName + "' given to: " + Thread.currentThread().getName());
        }
        getThreadLocks().add(lockName);
        locks.add(lockName);
    } else if (log.isDebugEnabled()) {
        log.debug("Lock '" + lockName + "' already owned by: " + Thread.currentThread().getName()
                + " -- but not owner!", new Exception("stack-trace of wrongful returner"));
    }

    return true;
}

From source file:org.red5.io.utils.IOUtils.java

/**
 * Format debug message/*  www .  j  a va2s .c o  m*/
 * @param log          Logger
 * @param msg          Message
 * @param buf          Byte buffer to debug
 */
public static void debug(Log log, String msg, ByteBuffer buf) {
    if (log.isDebugEnabled()) {

        log.debug(msg);
        log.debug("Size: " + buf.remaining());
        log.debug("Data:\n\n" + HexDump.formatHexDump(buf.getHexDump()));

        final String string = toString(buf);

        log.debug("\n" + string + "\n");

        //log.debug("Data:\n\n" + b);
    }
}