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

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

Introduction

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

Prototype

void warn(Object message);

Source Link

Document

Logs a message with warn log level.

Usage

From source file:LoggingTrial.java

public static void main(String[] args) {
    Log log = LogFactory.getLog(LoggingTrial.class);
    System.out.println("The Log being used >>> " + log);

    Exception e = new Exception("A DUMMY EXCEPTION");
    if (log.isTraceEnabled()) {
        log.trace("TRACE TEST");
        log.trace("TRACE TEST", e);
    }/*  ww  w  .jav a 2 s.  c om*/
    if (log.isDebugEnabled()) {
        log.debug("DEBUG TEST");
        log.debug("DEBUG TEST", e);
    }

    if (log.isInfoEnabled()) {
        log.info("INFO TEST");
        log.info("INFO TEST", e);
    }
    if (log.isWarnEnabled()) {
        log.warn("WARN TEST");
        log.warn("WARN TEST", e);
    }

    if (log.isErrorEnabled()) {
        log.error("ERROR TEST");
        log.error("ERROR TEST", e);
    }

    if (log.isFatalEnabled()) {
        log.fatal("FATAL TEST");
        log.fatal("FATAL TEST", e);
    }
}

From source file:com.microsoft.tfs.sdk.samples.console.LogConfigurationSample.java

private static void logAllLevels(final Log log, final String message) {
    log.trace(message);//from w w w.  j a v  a  2  s. c o m
    log.debug(message);
    log.info(message);
    log.warn(message);
    log.error(message);
    log.fatal(message);
}

From source file:it.crs4.seal.common.Utils.java

/**
 * Warn the user that he's using a deprecated property.
 * If newProperty is provided, the message will suggest to the user to substitute uses
 * of the deprecatedProperty with the new one.
 *///from  ww  w .j  a  v  a  2 s .com
public static void deprecationWarning(Log log, String deprecatedProperty, String newProperty) {
    log.warn("Your configuration is using the deprecated property " + deprecatedProperty);
    if (newProperty == null)
        log.warn("You should update your configuration to avoid using it.  See the documentation for details.");
    else
        log.warn("You should update your configuration to replace it with " + newProperty
                + ". See the documentation for details.");
}

From source file:com.oncore.calorders.core.utils.Logger.java

/**
 * Writes a warn log entry if it is enabled
 *
 * @author OnCore Consulting LLC//from www .  j  a v a  2s  .  c  o  m
 *
 * @param log a handle to the log
 * @param message the text to log
 */
public static void warn(final Log log, final String message) {
    if (log != null && message != null) {
        log.warn(message);

    }
}

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

private static Cursor createCursor(int id) {
    Toolkit tk = Toolkit.getDefaultToolkit();
    URL res = getResource(id);/*from  w  w  w .  jav a2s .  c  om*/

    if (res == null) {
        Log log = LogFactory.getLog(JTCursor.class);
        if (log.isWarnEnabled()) {
            log.warn("Could not find cursor: id=" + id + ", url=" + res);
        }
        return Cursor.getDefaultCursor();
    }

    Image img;
    try {
        img = ImageIO.read(res);
    } catch (IOException e) {
        Log log = LogFactory.getLog(JTCursor.class);
        if (log.isWarnEnabled()) {
            log.warn("Could not find cursor: id=" + id + ", url=" + res, e);
        }
        return Cursor.getDefaultCursor();
    }

    return tk.createCustomCursor(img, new Point(4, 16), names[id]);
}

From source file:com.rsmart.rfabric.logging.FormattedLogger.java

/**
 * Wraps {@link Log#warn(String)}//ww w . ja v a  2  s. c o  m
 * 
 * @param pattern to format against
 * @param objs an array of objects used as parameters to the <code>pattern</code>
 */
public static final void warn(String pattern, Object... objs) {
    Log log = getLog();
    if (log.isWarnEnabled()) {
        log.warn(getMessage(pattern, objs));
    }
}

From source file:com.diversityarrays.util.ClassPathExtender.java

private static void warn(Log logger, Object msg) {
    if (logger != null) {
        logger.warn(msg);
    } else {//from   ww  w. jav  a  2s . c o  m
        System.err.println(msg);
    }
}

From source file:edu.umn.msi.tropix.common.logging.ExceptionUtils.java

public static void logQuietly(final Log log, final Throwable t, final String message) {
    if (message != null) {
        log.warn(message);
    }//from   w  w  w  . ja  va 2 s  .com
    log.info("Exception Info : ", t);
}

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

/**
 * Log a message with warn log level.//w  w  w  .j  a  v a 2 s.c o  m
 *
 * @param log Log to write to
 * @param message log this message
 */
public static void warn(final Log log, final Object... message) {
    if (log.isWarnEnabled())
        log.warn(concat(message));
}

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

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