List of usage examples for org.apache.commons.logging Log warn
void warn(Object message);
From source file:com.datos.vfs.VfsLog.java
/** * warning.//from ww w. ja va 2 s .co m * @param vfslog The base component Logger to use. * @param commonslog The class specific Logger * @param message The message to log. */ public static void warn(final Log vfslog, final Log commonslog, final String message) { if (vfslog != null) { vfslog.warn(message); } else if (commonslog != null) { commonslog.warn(message); } }
From source file:Main.java
/** * Get a single child element with the given name. If more than one child with the given name * exists, a warning is logged.//ww w . j a v a2 s .c o m * * @param parent the parent node * @param name the name of the child element to get; may be null or "*" to indicate any * element child * @param log where to write the warning if more than one child element was found; may be * null to disable the warning * @return the child, or null if none was found */ public static Element getOnlyChild(Element parent, String name, Log log) { NodeList children = getChildren(parent, name); if (children.getLength() == 0) return null; if (children.getLength() > 1 && log != null) log.warn("Expected exactly one child named '" + name + "' of '" + parent.getTagName() + "' but got " + children.getLength()); return (Element) children.item(0); }
From source file:com.wavemaker.runtime.data.parser.BaseHbmParser.java
private static void setupEntityResolver(XMLInputFactory factory) { factory.setXMLResolver(new XMLResolver() { @Override//from www .java2s. c o m public Object resolveEntity(String publicId, String systemId, String s1, String s2) { if (HbmConstants.HBM_SYSTEM_ID.equals(systemId)) { InputStream rtn = ClassLoaderUtils .getResourceAsStream("com/wavemaker/tools/data/hibernate-mapping-3.0.dtd"); if (rtn == null) { // get rid of references to "tools" package Log parserLogger = LogFactory.getLog("com.wavemaker.tools.data.parser"); parserLogger.warn("Did not find local copy of \"hibernate-mapping-3.0.dtd\""); // DataServiceLoggers.parserLogger.warn( // // "Did not find local copy of \"hibernate-mapping-3.0.dtd\""); } else { return rtn; } } return null; } }); }
From source file:com.headissue.pigeon.util.LogUtils.java
public static void warn(Log log, String message, Object... args) { if (log.isWarnEnabled()) { if (args != null && args.length > 0) { message = String.format(message, args); }/* w w w. j ava 2 s . c om*/ log.warn(message); } }
From source file:com.arkatay.yada.base.Time.java
/** * Initializes the time system//from ww w.j av a2s.c om * */ public static void init() { // Create a logger for this class Log log = LogFactory.getLog(Time.class); // try the nanoTime method useNanoTimeMethod = true; try { System.nanoTime(); } catch (NoSuchMethodError err) { initTimeMillis = System.currentTimeMillis(); useNanoTimeMethod = false; log.warn("!!!"); log.warn("!!! The java runtime does not support the System.nanoTime method and this means that the"); log.warn("!!! timer accuracy on some computer may be too low for the codec to function properly!"); log.warn("!!! Consider using JRE 1.5.x or higher which supports the nanoTime method"); log.warn("!!!"); } }
From source file:es.tunelator.log.Logger.java
/** * @param source/*from ww w .j a v a2s. c o m*/ * @param e */ public static void logWarning(Class source, Throwable e) { Log log = LogFactory.getLog(es.tunelator.AppParameters.LOG_WARN); // Log log = LogFactory.getLog(source); log.warn(e); }
From source file:es.tunelator.log.Logger.java
/** * @param source/* ww w . j a v a 2 s . c o m*/ * @param msg */ public static void logWarning(Class source, String msg) { Log log = LogFactory.getLog(es.tunelator.AppParameters.LOG_WARN); // Log log = LogFactory.getLog(source); log.warn(msg); }
From source file:net.openhft.chronicle.logger.jcl.JclTestBase.java
protected static void log(Log logger, ChronicleLogLevel level, String message) { switch (level) { case TRACE:/* w w w .j a va 2s . c o m*/ logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); break; case ERROR: logger.error(message); break; default: throw new UnsupportedOperationException(); } }
From source file:com.runwaysdk.logging.RunwayLogUtil.java
public static void logToLevel(Log log, LogLevel level, String msg) { if (level == LogLevel.TRACE) { log.trace(msg);/*from w w w . j av a 2s . c o m*/ } else if (level == LogLevel.DEBUG) { log.debug(msg); } else if (level == LogLevel.INFO) { log.info(msg); } else if (level == LogLevel.WARN) { log.warn(msg); } else if (level == LogLevel.ERROR) { log.error(msg); } else if (level == LogLevel.FATAL) { log.fatal(msg); } else { log.fatal( "RunwayLogUtil.logToLevel was called, but an invalid level was specified. Here is the message we were passed: '" + msg + "'"); } }
From source file:edu.du.penrose.systems.fedoraApp.batchIngest.bus.BatchThreadManager.java
/** * Remove a stopped batch ingest from the list of active batch sets * /*from ww w. j av a 2 s.c o m*/ * NOTE: If the batch ingest is still running the batch set is not removed! If * there is not such batch ingest set, this call is ignored. * * @param batchSetName the batch set to remove. */ static public void removeBatchset(String batchSetName) { if (!isBatchSetThreadExists(batchSetName)) { return; } if (getBatchIngestThreads().get(batchSetName).getBatchIngestThread().isDone()) { getBatchIngestThreads().remove(batchSetName); } else { Log logger = LogFactory.getLog("edu.du.penrose.systems.fedoraApp.batchIngest.bus.BatchThreadManager"); logger.warn("Attempt to remove a running thread! Plase halt it first"); } }