List of usage examples for org.apache.commons.logging Log isInfoEnabled
boolean isInfoEnabled();
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); }/*from w w w .j a v a 2s . 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.headissue.pigeon.util.LogUtils.java
public static void info(Log log, String message, Object... args) { if (log.isInfoEnabled()) { if (args != null && args.length > 0) { message = String.format(message, args); }/* w w w. j a va 2 s.c o m*/ log.info(message); } }
From source file:com.headissue.pigeon.util.LogUtils.java
public static void info(Log log, Throwable t, String message, Object... args) { if (log.isInfoEnabled()) { if (args != null && args.length > 0) { message = String.format(message, args); }/* w ww . ja v a 2 s. c o m*/ log.info(message, t); } }
From source file:com.rsmart.rfabric.logging.FormattedLogger.java
/** * Wraps {@link Log#info(String)}/*from w w w.j a 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 info(String pattern, Object... objs) { Log log = getLog(); if (log.isInfoEnabled()) { log.info(getMessage(pattern, objs)); } }
From source file:com.oncore.calorders.core.utils.Logger.java
/** * Writes an info log entry if it is enabled * * @author OnCore Consulting LLC//from w w w . j ava2s .c o m * * @param log a handle to the log * @param message the text to log */ public static void info(final Log log, final String message) { if (log != null && message != null) { if (log.isInfoEnabled()) { log.info(message); } } }
From source file:com.stimulus.archiva.exception.ChainedException.java
public static Level getLoggingLevel(Log logger) { if (logger.isDebugEnabled()) return Level.DEBUG; else if (logger.isInfoEnabled()) return Level.INFO; else if (logger.isWarnEnabled()) return Level.WARN; else if (logger.isErrorEnabled()) return Level.ERROR; else if (logger.isFatalEnabled()) return Level.FATAL; return Level.DEBUG; }
From source file:com.buffalokiwi.api.APILog.java
/** * Log a message with info log level./*from w ww . ja va 2 s . c o m*/ * * @param log Log to write to * @param message log this message */ public static void info(final Log log, final Object... message) { if (log.isInfoEnabled()) log.info(concat(message)); }
From source file:net.sf.nmedit.nomad.core.jpf.JPFServiceInstallerTool.java
public static void activateAllServices(Plugin mainPlugin) { Log log = getLogger(); if (log.isInfoEnabled()) { log.info("Activating services..."); }//from ww w . ja va2 s .co m Map<String, Class<Service>> serviceClassCache = new HashMap<String, Class<Service>>(); ExtensionPoint serviceExtensionPoint = mainPlugin.getDescriptor().getExtensionPoint("Service"); Collection<Extension> connectedExtensions = serviceExtensionPoint.getConnectedExtensions(); PluginManager manager = mainPlugin.getManager(); if (log.isInfoEnabled()) { log.info("Connected extensions: " + connectedExtensions.size()); } for (Extension extension : connectedExtensions) { ClassLoader pluginClassLoader = manager.getPluginClassLoader(extension.getDeclaringPluginDescriptor()); activateService(log, serviceClassCache, extension, pluginClassLoader); } }
From source file:framework.retrieval.engine.common.RetrievalUtil.java
public static void infoLog(Log log, Object msg) { if (log.isInfoEnabled()) { log.info(msg); } }
From source file:com.buffalokiwi.api.APILog.java
/** * Log an error with info log level.//from www.j ava2s . c o m * * @param log Log to write to * @param message log this message * @param t log this cause */ public static void info(final Log log, final Throwable t, final Object... message) { if (log.isInfoEnabled()) log.info(concat(message), t); }