@Override protected void execute() { try { processConnection(); } catch (IOException e) { logger.info( MockWebServer.this + " connection from " + raw.getInetAddress() + " failed: " + e); } catch (Exception e) { logger.log(Level.SEVERE, MockWebServer.this + " connection from " + raw.getInetAddress() + " crashed", e); } }
arguments.add(defaultJava); arguments.add("-Xms" + startMem + "m"); arguments.add("-Xmx" + maxMem + "m"); arguments.add("-XX:MaxMetaspaceSize=" + maxPerm + "m"); if (dbDebugMode) { arguments.add("-jar"); arguments.add(new File(getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getAbsolutePath()); LOG.info("Running server as: " + arguments); String[] args = arguments.toArray(new String[arguments.size()]);
logger.info("自定义词典开始加载:" + mainPath); if (loadDat(mainPath, dat)) return true; TreeMap<String, CoreDictionary.Attribute> map = new TreeMap<String, CoreDictionary.Attribute>(); logger.info("以默认词性[" + defaultNature + "]加载自定义词典" + p + "中……"); boolean success = load(p, defaultNature, map, customNatureCollector); if (!success) logger.warning("失败:" + p); logger.warning("没有加载到任何词条"); logger.info("正在构建DoubleArrayTrie……"); dat.build(map); if (isCache) logger.info("正在缓存词典为dat文件……"); attributeList.add(entry.getValue()); out.writeInt(attributeList.size()); for (CoreDictionary.Attribute attribute : attributeList) logger.warning("自定义词典" + mainPath + "缓存失败!\n" + TextUtility.exceptionToString(e));
public GCModel read() throws IOException { if (getLogger().isLoggable(Level.INFO)) getLogger().info("Reading Sun 1.3.1 format..."); try { count = 0; char c = (char) i; if (c == '[') { if (line != null) lineStack.add(line); // push line = new StringBuilder(64); if (getLogger().isLoggable(Level.WARNING)) getLogger().log(Level.WARNING, e.getMessage(), e); e.printStackTrace(); line = lineStack.remove(lineStack.size() - 1); // pop if (getLogger().isLoggable(Level.INFO)) getLogger().info("Done reading.");
public List<String> annotateMulticlass(List<Datum<String, String>> testDatums) { List<String> predictedLabels = new ArrayList<>(); for (Datum<String, String> testDatum: testDatums) { String label = classOf(testDatum, null); Counter<String> probs = probabilityOf(testDatum); double prob = probs.getCount(label); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); if (logger.isLoggable(Level.FINE)) { justificationOf(testDatum, pw, label); } logger.fine("JUSTIFICATION for label GOLD:" + testDatum.label() + " SYS:" + label + " (prob:" + prob + "):\n" + sw.toString() + "\nJustification done."); predictedLabels.add(label); if(! testDatum.label().equals(label)){ logger.info("Classification: found different type " + label + " for relation: " + testDatum); } else{ logger.info("Classification: found similar type " + label + " for relation: " + testDatum); } } return predictedLabels; }
private static List<JavaFile> getJavaFiles(File configFile) throws Exception { final List<JavaFile> javaFiles = new LinkedList<>(); try (BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(configFile), "UTF-8"))) { while (r.ready()) { final String className = r.readLine(); if (!className.startsWith("#")) { javaFiles.add(new JavaFile(className, SRC_MAIN_JAVA)); LOGGER.info(String.format(" + included class %s.\n", className)); } else { LOGGER.info(String.format(" - ignored class %s\n", className.substring(1))); } } } return javaFiles; }
cmd.add("-props"); cmd.add(propsFile); ProcessBuilder pb = new ProcessBuilder(cmd); pbEnv.putAll(curEnv); logger.info("Running distributed coref:" + StringUtils.join(pb.command(), " ")); StringWriter outSos = new StringWriter(); StringWriter errSos = new StringWriter(); String outStr = outSos.toString(); String errStr = errSos.toString(); logger.info("Finished distributed coref: " + runDistCmd + ", props=" + propsFile); logger.info("Output: " + outStr); if (errStr.length() > 0) { logger.info("Error: " + errStr);
File classes = new File(expandDir, "WEB-INF/classes"); if (classes.exists()) { // should not normally happen, due to createClassJarFromWebInfClasses LOGGER.log(Level.WARNING, "Deprecated unpacked classes directory found in {0}", classes); paths.add(classes); LOGGER.info("Plugin " + archive.getName() + " is disabled"); PluginWrapper.Dependency d = new PluginWrapper.Dependency(s); if (d.optional) { optionalDependencies.add(d); } else { dependencies.add(d);
logger.warning("读取" + path + "失败" + e); return false; for (Map.Entry<String, V> entry : entrySet) keyList.add(entry.getKey()); valueList.add(entry.getValue()); logger.warning("trie建立失败"); return false; logger.info(path + "加载成功,耗时" + (System.currentTimeMillis() - start) + "ms"); saveDat(path + BIN_EXT, valueList); return true;
if (!(appender instanceof ConsoleAppender || appender instanceof FileAppender)) { appenders.add(appender); logFileName = new File(loader.getBaseDirectory(), logFileName).getAbsolutePath(); LoggingInitializer.LOGGER.fine( "Non-absolute pathname detected for logfile. Setting logfile relative to data dir."); LoggingInitializer.LOGGER.fine("Logging output to file '" + logFileName + "'"); } else if (gslf != null) { LoggingInitializer.LOGGER.warning( "'log4j.appender.geoserverlogfile' appender is defined, but isn't a FileAppender. GeoServer won't control the file-based logging."); } else { LoggingInitializer.LOGGER.warning( "'log4j.appender.geoserverlogfile' appender isn't defined. GeoServer won't control the file-based logging."); LoggingInitializer.LOGGER.info( "Suppressing StdOut logging. If you want to see GeoServer logs, be sure to look in '" + logFileName LogManager.getRootLogger().addAppender(appender); LoggingInitializer.LOGGER.fine( "FINISHED CONFIGURING GEOSERVER LOGGING -------------------------");
boolean sentinelAvailable = false; log.info("Trying to find master from available Sentinels..."); log.fine("Connecting to Sentinel " + hap); if (masterAddr == null || masterAddr.size() != 2) { log.warning("Can not get master addr, master name: " + masterName + ". Sentinel: " + hap + "."); continue; log.fine("Found Redis master at " + master); break; } catch (JedisException e) { log.warning("Cannot get master address from sentinel running @ " + hap + ". Reason: " + e + ". Trying next one."); } finally { log.info("Redis master running at " + master + ", starting Sentinel listeners...");
logger.fine(timeStamp); logger.fine(props.toString()); Constants.printConstants(logger); logger.warning("No mention finder specified, but not using gold mentions"); runAndScoreCoref(corefSystem, mentionExtractor, props, timeStamp); } catch (Exception ex) { logger.log(Level.SEVERE, "ERROR in running coreference", ex); logger.info("done"); String endTimeStamp = Calendar.getInstance().getTime().toString().replaceAll("\\s", "-"); logger.fine(endTimeStamp);
/** * Creates a hudson.PluginStrategy, looking at the corresponding system property. */ protected PluginStrategy createPluginStrategy() { String strategyName = SystemProperties.getString(PluginStrategy.class.getName()); if (strategyName != null) { try { Class<?> klazz = getClass().getClassLoader().loadClass(strategyName); Object strategy = klazz.getConstructor(PluginManager.class) .newInstance(this); if (strategy instanceof PluginStrategy) { LOGGER.info("Plugin strategy: " + strategyName); return (PluginStrategy) strategy; } else { LOGGER.warning("Plugin strategy (" + strategyName + ") is not an instance of hudson.PluginStrategy"); } } catch (ClassNotFoundException e) { LOGGER.warning("Plugin strategy class not found: " + strategyName); } catch (Exception e) { LOGGER.log(WARNING, "Could not instantiate plugin strategy: " + strategyName + ". Falling back to ClassicPluginStrategy", e); } LOGGER.info("Falling back to ClassicPluginStrategy"); } // default and fallback return new ClassicPluginStrategy(this); }
@Nullable private SocketChannel createConnection() { while (!closed) { try { readBuffer.clear(); readBuffer.limit(0); SocketChannel sc = SocketChannel.open(address); sc.socket().setReceiveBufferSize(256 * 1024); logger.info("Connected to " + address); ByteBuffer bb = ByteBuffer.allocate(8); bb.putLong(0, chronicle.size()); IOTools.writeAllOrEOF(sc, bb); return sc; } catch (IOException e) { if (logger.isLoggable(Level.FINE)) logger.log(Level.FINE, "Failed to connect to " + address + " retrying", e); else if (logger.isLoggable(Level.INFO)) logger.log(Level.INFO, "Failed to connect to " + address + " retrying " + e); } try { Thread.sleep(500); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } } return null; }
Redwood.startTrack("Adaptor test controlled by redwood"); Logger topLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); topLogger.warning("I'm warning you!"); topLogger.severe("Now I'm using my severe voice."); topLogger.info("FYI"); topLogger.warning("I'm warning you in Redwood!"); topLogger.info("FYI: Redwood rocks"); } else { Logger topLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); // Can be Logger.getGlobal() in jdk1.7 Logger logger = Logger.getLogger(JavaUtilLoggingAdaptor.class.getName()); topLogger.info("Starting test"); logger.log(Level.INFO, "Hello from the class logger"); Redwood.log("Hello from Redwood -> Java!"); Redwood.log("Hello from Redwood -> Java again!"); logger.log(Level.INFO, "Hello again from the class logger"); Redwood.startTrack("a track"); Redwood.log("Inside a track"); logger.log(Level.INFO, "Hello a third time from the class logger"); Redwood.endTrack("a track"); logger.log(Level.INFO, "Hello a fourth time from the class logger");
/** * Called when a received event message could not be parsed successfully. * <p> * This typically indicates a broken device which is not UPnP compliant. You can * react to this failure in any way you like, for example, you could terminate * the subscription or simply create an error report/log. * </p> * <p> * The default implementation will log the exception at <code>INFO</code> level, and * the invalid XML at <code>FINE</code> level. * </p> * * @param remoteGENASubscription The established subscription. * @param ex Call {@link org.fourthline.cling.model.UnsupportedDataException#getData()} to access the invalid XML. */ protected void invalidMessage(RemoteGENASubscription remoteGENASubscription, UnsupportedDataException ex) { log.info("Invalid event message received, causing: " + ex); if (log.isLoggable(Level.FINE)) { log.fine("------------------------------------------------------------------------------"); log.fine(ex.getData() != null ? ex.getData().toString() : "null"); log.fine("------------------------------------------------------------------------------"); } }
underTest.getRootContext().getLogger(logbackRootLoggerName).addAppender(memoryAppender); java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger("com.ms.sqlserver.jdbc.DTV"); julLogger.finest("Message1"); julLogger.finer("Message1"); julLogger.fine("Message1"); julLogger.info("Message1"); julLogger.warning("Message1"); julLogger.severe("Message1"); julLogger.fine("Message2"); julLogger.info("Message2"); julLogger.warning("Message2"); julLogger.severe("Message2"); assertThat(julLogger.isLoggable(java.util.logging.Level.FINEST)).isTrue(); assertThat(julLogger.isLoggable(java.util.logging.Level.FINER)).isTrue(); assertThat(julLogger.isLoggable(java.util.logging.Level.FINE)).isTrue(); assertThat(julLogger.isLoggable(java.util.logging.Level.INFO)).isTrue(); assertThat(julLogger.isLoggable(java.util.logging.Level.SEVERE)).isTrue(); julLogger.fine("Message3"); julLogger.info("Message3"); julLogger.warning("Message3"); julLogger.severe("Message3");
/** {@inheritDoc} */ @Override public void info(String msg) { if (!impl.isLoggable(INFO)) warning("Logging at INFO level without checking if INFO level is enabled: " + msg); impl.info(msg); }