当前位置: 首页>>代码示例>>Java>>正文


Java Logger.warning方法代码示例

本文整理汇总了Java中java.util.logging.Logger.warning方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.warning方法的具体用法?Java Logger.warning怎么用?Java Logger.warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.logging.Logger的用法示例。


在下文中一共展示了Logger.warning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: waitInstancesZero

import java.util.logging.Logger; //导入方法依赖的package包/类
public static void waitInstancesZero(Logger l) throws InterruptedException {
    for (int i = 0; i < 10; i++) {
        synchronized (INSTANCES_LOCK) {
            if (INSTANCES == 0) return;
            
            l.warning("instances still there: " + INSTANCES);
        }
        
        ActionsInfraHid.doGC();
        
        synchronized (INSTANCES_LOCK) {
            l.warning("after GC, do wait");
            
            INSTANCES_LOCK.wait(1000);
            l.warning("after waiting");
        }
    }
    failInstances("Instances are not zero");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:CallbackSystemActionTest.java

示例2: addFactory

import java.util.logging.Logger; //导入方法依赖的package包/类
/**
 * Adds a compound factory.
 * @param factory
 * @param logger
 */
public void addFactory(F factory, Logger logger) {
    if (factories.values().contains(factory)) {
        if (logger != null)
            logger.warning("compound service factory has already factory " + factory);
        return;
    }
    for (K key : factory.supportedServices()) {
        if (factories.containsKey(key)) {
            if (logger != null)
                logger.warning("compound service factory has already factory for " + key);
            continue;
        }
        factories.put(key, factory);
        for (String alias : autoAlias(key)) {
            // System.err.println("add alias = " + alias);
            addAlias(alias, key);
        }
    }
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:25,代码来源:CompositeServiceFactory.java

示例3: loglevel

import java.util.logging.Logger; //导入方法依赖的package包/类
public void loglevel(Level l, Logger logger, String message) {
    LogTest test = LogTest.valueOf("LEV_"+l.getName());
    switch(test) {
        case LEV_SEVERE:
            logger.severe(message);
            break;
        case LEV_WARNING:
            logger.warning(message);
            break;
        case LEV_INFO:
            logger.info(message);
            break;
        case LEV_CONFIG:
            logger.config(message);
            break;
        case LEV_FINE:
            logger.fine(message);
            break;
        case LEV_FINER:
            logger.finer(message);
            break;
        case LEV_FINEST:
            logger.finest(message);
            break;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:27,代码来源:TestIsLoggable.java

示例4: loadGamePatterns

import java.util.logging.Logger; //导入方法依赖的package包/类
public static void loadGamePatterns(List<Map> source, Set<GamePattern> gamePatterns, Logger logger) {
	gamePatterns.clear();
	for (Map map : source) {
		if (!map.containsKey("pattern")) {
			logger.warning("Missing 'pattern' key");
			continue;
		}
		if (!map.containsKey("game")) {
			logger.warning("Missing 'game' key");
			continue;
		}

		GamePattern pattern = new GamePattern((String) map.get("pattern"), (String) map.get("game"));
		gamePatterns.add(pattern);
		logger.info(pattern.getPattern().pattern() + " -> " + pattern.getGame());
	}
}
 
开发者ID:MCGameInfo,项目名称:MCGameInfoPlugin,代码行数:18,代码来源:Util.java

示例5: processOutput

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
  public void processOutput(BufferedReader out, BufferedReader err) throws ModuleException {
      if (silent) {
	return;
}
      Logger logger = owner.getLogger(ctx);
      try {
          logger.fine("tree-tagger standard error:");
          for (String line = err.readLine(); line != null; line = err.readLine()) {
              logger.fine("    " + line);
          }
          logger.fine("end of tree-tagger standard error");
      }
      catch (IOException ioe) {
          logger.warning("could not read tree-tagger standard error: " + ioe.getMessage());
      }
  }
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:18,代码来源:TreeTaggerExternal.java

示例6: throwIOThrowable

import java.util.logging.Logger; //导入方法依赖的package包/类
/** Used in testIOExceptionIsWrappedWithLogMsg. */
public void throwIOThrowable() throws Throwable {
    Logger log = Logger.getLogger(getName());
    if (toMsg != null) {
        log.log(Level.WARNING, "Msg", toMsg);
    }
    log.warning("Going to throw: " + toThrow);
    throw toThrow;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:LoggingTest.java

示例7: FloydWarshall

import java.util.logging.Logger; //导入方法依赖的package包/类
/**
 * FloydWarshall configured with "map" and agent-specific view on the map, if "view" is null, {@link DefaultView} is going to be used.
 * <p><p>
 * {@link FloydWarshall#compute()} method is immediately called from within this constructor.
 *  
 * @param map
 * @param view may be null
 * @param log may be null
 */
public FloydWarshall(IPFKnownMap<NODE> map, IPFKnownMapView<NODE> view, Logger log) {
	this.map = map;
	this.view = view;
	NullCheck.check(this.map, "map");
	this.log = log;
	if (this.view == null) {
		if (log != null && log.isLoggable(Level.WARNING)) log.warning("No view specified! IPFKnownMapView.DefaultView is going to be used.");
		this.view = new IPFKnownMapView.DefaultView();
	}		
	compute();
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:21,代码来源:FloydWarshall.java

示例8: process

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
public void process(ProcessingContext<Corpus> ctx, Corpus corpus) throws ModuleException {
	AssertResolvedObjects resObj = getResolvedObjects();
	Logger logger = getLogger(ctx);
	EvaluationContext evalCtx = new EvaluationContext(logger);
	try (PrintStream out = openStream()) {
		int failures = 0;
		int checked = 0;
		for (Element elt : Iterators.loop(resObj.target.evaluateElements(evalCtx, corpus))) {
			checked++;
			resObj.targetVariable.set(elt);
			if (!resObj.assertion.evaluateBoolean(evalCtx, elt)) {
				failures++;
				String message = resObj.getMessage(evalCtx, elt);
				logger.warning(message);
				if (out != null) {
					out.println(message);
				}
				if (stopAt != null && failures == stopAt.intValue())
					break;
			}
		}
		String msg = "assertion failures: " + failures;
		if (severe && failures > 0) {
			if (out != null) {
				out.println(msg);
			}
			processingException(msg);
		}
		else {
			logger.info("elements checked: " + checked);
			logger.info(msg);
		}
	}
	catch (IOException e) {
		rethrow(e);
	}
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:39,代码来源:Assert.java

示例9: trace

import java.util.logging.Logger; //导入方法依赖的package包/类
/**
 * Log a warning with a stack trace.
 *
 * @param logger The {@code Logger} to log to.
 * @param warn The warning message.
 */
public static void trace(Logger logger, String warn) {
    LogBuilder lb = new LogBuilder(512);
    lb.add(warn, "\n");
    addStackTrace(lb);
    logger.warning(lb.toString());
}
 
开发者ID:wintertime,项目名称:FreeCol,代码行数:13,代码来源:FreeColDebugger.java

示例10: process

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
public void process(ProcessingContext<Corpus> ctx, Corpus corpus) throws ModuleException {
	Logger logger = getLogger(ctx);
	EvaluationContext evalCtx = new EvaluationContext(logger);
	try (Trie<T> trie = getTrie(ctx, logger, corpus)) {
		StandardMatchControl control = getControl();
		subject.correctControl(control);
		Matcher<T> matcher = new Matcher<T>(trie, control);
		logger.info("searching...");
		int nMatches = 0;
		for (Section sec : Iterators.loop(sectionIterator(evalCtx, corpus))) {
			matcher.init();
			List<Match<T>> matches = subject.search(matcher, sec);
			nMatches += matches.size();
			Layer targetLayer = sec.ensureLayer(targetLayerName);
			for (Match<T> match : matches)
				multipleEntryBehaviour.handle(this, targetLayer, match);
		}
		
		if (nMatches == 0) {
			logger.warning("found no matches");
		}
		else {
			logger.info("found " + nMatches + " matches");
		}
		finish();

		if (trieSink != null && trieSource == null) {
			Encoder<T> encoder = getEncoder();
			logger.info("saving trie into " + trieSink);
			trie.save(trieSink, encoder);
		}
	}
	catch (IOException e) {
		rethrow(e);
	}
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:38,代码来源:TrieProjector.java

示例11: fillTrie

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
protected void fillTrie(Logger logger, Trie<List<String>> trie, Corpus corpus) throws IOException, ModuleException {
	logger.info("reading dictionary from: " + dictFile);
	TabularFormat format = new TabularFormat();
	format.setNumColumns(valueFeatures.length);
	logger.info("we expect lines with " + valueFeatures.length + " columns");
	format.setSeparator(separator);
	if (!strictColumnNumber)
		logger.warning("you deliberately choose to ignore malformed dictionary lines");
	format.setStrictColumnNumber(strictColumnNumber);
	if (skipEmpty)
		logger.warning("skipping empty lines");
	format.setSkipEmpty(skipEmpty);
	if (skipBlank)
		logger.warning("skipping lines with only whitespace");
	format.setSkipBlank(skipBlank);
	if (trimColumns)
		logger.warning("columns will be trimmed from leading and trailing whitespace");
	format.setTrimColumns(trimColumns);
	FileLines<Trie<List<String>>> fl = new EntryFileLines(format, keyIndex);
	try {
		fl.process(dictFile, trie);
	}
	catch (InvalidFileLineEntry e) {
		rethrow(e);
	}
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:28,代码来源:TabularProjector.java

示例12: getStripLayer

import java.util.logging.Logger; //导入方法依赖的package包/类
private Layer getStripLayer(Logger logger, Section sec) {
	Layer stripLayer = sec.getLayer(stripLayerName);
	if (stripLayer.hasOverlaps()) {
		logger.warning("overlapping annotations, merging");
		return mergeOverlapping(stripLayer);
	}
	return stripLayer;
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:9,代码来源:RemoveContents.java

示例13: run

import java.util.logging.Logger; //导入方法依赖的package包/类
private void run(String[] args) throws Exception {
  // TODO(bazel-team) how will I receive the source files from the user.
  try {
    CmdLineParser cmdLineParser = new CmdLineParser(this);
    cmdLineParser.parseArgument(args);
  } catch (CmdLineException e) {
    if (sourceFiles.isEmpty()) {
      System.err.println("Must provide file names to parse.");
    } else {
      System.err.println(e.getMessage());
    }
    e.getParser().printUsage(System.err);
    System.exit(1);
  }

  ImmutableList<Path> contentRoots =
      stream(Splitter.on(',').split(contentRootPaths))
          .map(root -> Paths.get(root))
          .collect(toImmutableList());

  ImmutableList<Path> sourceFilePaths =
      sourceFiles.stream().map(p -> Paths.get(p)).collect(toImmutableList());

  ImmutableSet<Path> oneRulePerPackagePaths =
      stream(Splitter.on(',').split(oneRulePerPackageRoots))
          .map(root -> Paths.get(root))
          .collect(toImmutableSet());

  JavaSourceFileParser parser =
      new JavaSourceFileParser(sourceFilePaths, contentRoots, oneRulePerPackagePaths);

  Set<String> unresolvedClassNames = parser.getUnresolvedClassNames();
  if (!unresolvedClassNames.isEmpty()) {
    Logger logger = Logger.getLogger(JavaSourceFileParserCli.class.getName());
    logger.warning(
        String.format("Class Names not found %s", Joiner.on("\n\t").join(unresolvedClassNames)));
  }

  // Write results to stdout.
  serializeResults(parser).writeTo(System.out);
}
 
开发者ID:bazelbuild,项目名称:BUILD_file_generator,代码行数:42,代码来源:JavaSourceFileParserCli.java

示例14: processSentence

import java.util.logging.Logger; //导入方法依赖的package包/类
private void processSentence(PrintStream out, Logger logger, Collection<Tuple> dependencies, Section sec, Annotation sent) {
	out.println(">>");
	out.println(">Word");
	IndexHashMap<Annotation> wordIndex = new IndexHashMap<Annotation>();
	Layer wordLayer = sec.getLayer(words);
	StringBuilder sb = new StringBuilder();
	for (Annotation w : wordLayer.between(sent)) {
		sb.setLength(0);
		Strings.escapeWhitespaces(sb, w.getLastFeature(wordForm));
		out.format("%d\t\"%s\"\n", wordIndex.safeGet(w), sb);
	}
	if (entities != null) {
		for (String name : entities) {
			Layer entityLayer = sec.ensureLayer(name);
			out.println(">Entities");
			for (Annotation e : entityLayer.between(sent)) {
				Layer includedWords = wordLayer.overlapping(e);
				if (includedWords.isEmpty()) {
					logger.warning("entity " + e + " dos not include any word");
					continue;
				}
				if (includedWords.size() == 1) {
					out.format("%d\t\"%s\"\n", wordIndex.safeGet(includedWords.first()), e.getLastFeature(entityType));
				}
				else {
					out.format("%d\t%d\t\"%s\"\n", wordIndex.safeGet(includedWords.first()), wordIndex.safeGet(includedWords.last()), e.getLastFeature(entityType));
				}
			}
		}
	}
	out.println(">Relations");
	for (Tuple t : dependencies) {
		if (!t.hasArgument(head)) {
			logger.warning("dependency without head");
			continue;
		}
		if (!t.hasArgument(dependent)) {
			logger.warning("dependency without dependent");
			continue;
		}
		Annotation headWord = DownCastElement.toAnnotation(t.getArgument(head));
		Annotation dependentWord = DownCastElement.toAnnotation(t.getArgument(dependent));
		if (!wordLayer.contains(headWord)) {
			logger.warning("head not in the word layer");
			continue;
		}
		if (!wordLayer.contains(dependentWord)) {
			logger.warning("dependent not in the word layer");
			continue;
		}
		if (!wordIndex.containsKey(headWord)) {
			logger.warning("head outisde sentence");
			continue;
		}
		if (!wordIndex.containsKey(dependentWord)) {
			logger.warning("dependent outisde sentence");
			continue;
		}
		int h = wordIndex.get(headWord);
		int d = wordIndex.get(dependentWord);
		out.format("%d\t%d\t\"%s\"\n", h, d, t.getLastFeature(label));
	}
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:64,代码来源:WhatsWrongExport.java

示例15: warn

import java.util.logging.Logger; //导入方法依赖的package包/类
@Function
public Iterator<Element> warn(String msg) {
	Logger logger = module.getLogger(ctx);
	logger.warning(msg);
	return Iterators.emptyIterator();
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:7,代码来源:ModuleLibrary.java


注:本文中的java.util.logging.Logger.warning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。