List of usage examples for org.apache.commons.logging Log info
void info(Object 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..."); }// w w w . j a v a 2 s . c om 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:net.gleamynode.netty2.SessionLog.java
public static void info(Log log, Session session, Object obj) { log.info(getMessage(session, obj)); }
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.datos.vfs.VfsLog.java
/** * info./*w w w . ja v a 2s. c om*/ * @param vfslog The base component Logger to use. * @param commonslog The class specific Logger * @param message The message to log. */ public static void info(final Log vfslog, final Log commonslog, final String message) { if (vfslog != null) { vfslog.info(message); } else if (commonslog != null) { commonslog.info(message); } }
From source file:com.alibaba.wasp.util.ResultInHBasePrinter.java
private static void print(ResultScanner indexrs, Log LOG) throws UnsupportedEncodingException { for (Result r : indexrs) { KeyValue[] kv = r.raw();/*from ww w . ja v a2s .c om*/ for (int i = 0; i < kv.length; i++) { LOG.info("row:" + Bytes.toString(kv[i].getRow())); LOG.info("row length:" + kv[i].getRow().length); LOG.info("family:" + Bytes.toString(kv[i].getFamily())); LOG.info("qualifier:" + Bytes.toString(kv[i].getQualifier())); LOG.info("value:" + Bytes.toString(kv[i].getValue())); LOG.info("value length:" + kv[i].getValue().length); LOG.info("timestamp:" + kv[i].getTimestamp()); } } }
From source file:com.alibaba.wasp.util.ResultInHBasePrinter.java
public static void printTable(String type, String table, Configuration conf, Log LOG) throws IOException { StorageActionManager manager = new StorageActionManager(conf); try {//from www .ja v a2 s . c o m ResultScanner fmeters = manager.scan(table, new Scan()); LOG.info("rs " + type); print(fmeters, LOG); LOG.info("rs end"); } catch (UnsupportedEncodingException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } }
From source file:com.CodeSeance.JSeance.CodeGenXML.XMLElements.Template.java
public static String run(File templateFile, File includesDir, File modelsDir, File targetDir, boolean ignoreReadOnlyOuputFiles, TemplateDependencies templateDependencies) { // Create a local logger for the static context Log log = com.CodeSeance.JSeance.CodeGenXML.Runtime.CreateLogger(Template.class); if (log.isInfoEnabled()) { log.info(String.format("Loading Template:[%s]", templateFile.toString())); }// w ww . j a v a2s . c o m // Load the default schema validator XMLLoader xmlLoader = XMLLoader.buildFromCodeTemplateSchema(); // Loads the XML document Document document; try { InputStream inputStream = new FileInputStream(templateFile); document = xmlLoader.loadXML(inputStream); } catch (FileNotFoundException ex) { throw new RuntimeException(ExecutionError.INVALID_TEMPLATE_FILE.getMessage(templateFile.toString()), ex); } catch (SAXException ex) { throw new RuntimeException( ExecutionError.INVALID_TEMPLATE_XML.getMessage(templateFile.toString(), ex.getMessage()), ex); } // Load the object hierarchy from the XMLDocument Template template = new Template(document.getDocumentElement()); if (log.isInfoEnabled()) { log.info("XMLSchema validated"); } // Create a new ContextManager ContextManager contextManager = new ContextManager(includesDir, modelsDir, targetDir, ignoreReadOnlyOuputFiles, templateDependencies); try { // Enter and leave the context on the new template element template.onContextEnter(contextManager.getCurrentContext()); template.onContextExit(contextManager.getCurrentContext()); } finally { // dispose the context manager to release used resources contextManager.dispose(); } return template.buffer.toString(); }
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); }/*from ww w.j a v a 2 s. co m*/ log.info(message); } }
From source file:com.ery.estorm.util.ToolUtil.java
public static synchronized Process runProcess(String command, Log log) throws IOException { log.info("" + command); // Process proc = Runtime.getRuntime().exec(new String[] { command }); Process proc = Runtime.getRuntime().exec(command); return proc;//from w ww . ja va 2 s .co m }
From source file:com.diversityarrays.util.ClassPathExtender.java
public static void addDirectoryJarsToClassPath(Log logger, Consumer<File> jarChecker, File... dirs) { if (dirs == null || dirs.length <= 0) { if (logger != null) { logger.info("No directories provided for class path"); }//from w w w .j a v a2 s. co m return; } ClassLoader ccl = Thread.currentThread().getContextClassLoader(); if (ccl instanceof java.net.URLClassLoader) { try { Method m = java.net.URLClassLoader.class.getDeclaredMethod("addURL", URL.class); m.setAccessible(true); Set<URL> currentUrls = new HashSet<URL>(Arrays.asList(((URLClassLoader) ccl).getURLs())); if (VERBOSE) { info(logger, "=== Current URLS in ClassLoader: " + currentUrls.size()); for (URL u : currentUrls) { info(logger, "\t" + u.toString()); } } for (File dir : dirs) { if (dir.isDirectory()) { for (File f : dir.listFiles(JAR_OR_PROPERTIES)) { try { URL u = f.toURI().toURL(); if (!currentUrls.contains(u)) { m.invoke(ccl, u); if (VERBOSE) { info(logger, "[Added " + u + "] to CLASSPATH"); } if (jarChecker != null) { jarChecker.accept(f); } } } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | MalformedURLException e) { warn(logger, "%Unable to add " + f.getPath() + " to CLASSPATH (" + e.getMessage() + ")"); } } } } } catch (NoSuchMethodException e) { warn(logger, "%No method: " + java.net.URLClassLoader.class.getName() + ".addURL(URL)"); } } else { warn(logger, "%currentThread.contextClassLoader is not an instance of " + java.net.URLClassLoader.class.getName()); } }