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


Java Logger.info方法代码示例

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


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

示例1: writeCrossValidationResults

import java.util.logging.Logger; //导入方法依赖的package包/类
@TimeThis(task="write-results", category=TimerCategory.EXPORT)
protected void writeCrossValidationResults(ProcessingContext<Corpus> ctx, TargetStream evaluationFile, Evaluation evaluation, String[] classes) throws Exception {
	Logger logger = getLogger(ctx);
       logger.info("writing test results into " + evaluationFile.getName());
       try (PrintStream out = evaluationFile.getPrintStream()) {
       	for (int i = 0; i < classes.length; ++i) {
       		out.printf("Results for class %d (%s):\n", i, classes[i]);
       		out.printf("  True positives : %8.0f\n", evaluation.numTruePositives(i));
       		out.printf("  False positives: %8.0f\n", evaluation.numFalsePositives(i));
       		out.printf("  True negatives : %8.0f\n", evaluation.numTrueNegatives(i));
       		out.printf("  False negatives: %8.0f\n", evaluation.numFalseNegatives(i));
       		out.printf("  Recall:    %6.4f\n", evaluation.recall(i));
       		out.printf("  Precision: %6.4f\n", evaluation.precision(i));
       		out.printf("  F-Measure: %6.4f\n", evaluation.fMeasure(i));
       		out.println();
       	}
       	out.println(evaluation.toMatrixString("Confusion matrix:"));
       }
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:20,代码来源:WekaTrain.java

示例2: testEarlyPublish

import java.util.logging.Logger; //导入方法依赖的package包/类
public void testEarlyPublish() throws Exception {
    EarlyHandler eh = Lookup.getDefault().lookup(EarlyHandler.class);
    Logger allLogger = Logger.getLogger("org.myapplication.ui.test_early"); // Copied Installer.UI_LOGGER_NAME, not to initialize Installer class.
    allLogger.setLevel(Level.ALL);
    allLogger.addHandler(eh);
    
    allLogger.fine("Test Message 1");
    allLogger.info("Test Message 2");
    allLogger.finest("Test Message 3");
    
    Installer installer = Installer.findObject(Installer.class, true);
    installer.restored();
    assertEquals("EarlyHandler turned off", Level.OFF, eh.getLevel());
    
    allLogger.finer("Test Message 4");
    
    List<LogRecord> logs = InstallerTest.getLogs();
    assertEquals("Number of messages logged: ", 4, logs.size());
    for (int i = 0; i < logs.size(); i++) {
        assertEquals("Test Message "+(i+1), logs.get(i).getMessage());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:EarlyHandlerTest.java

示例3: fillTrie

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
protected void fillTrie(Logger logger, Trie<Resource> trie, Corpus corpus) throws IOException, ModuleException {
	Model model = createModel(logger);
	Property typeProp = model.getProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
	Property[] labelPropertyProps = getProperties(model, labelURIs);
	int nEntries = 0;
	for (String resourceTypeURI : resourceTypeURIs) {
		Property resourceType = model.getProperty(model.expandPrefix(resourceTypeURI));
		for (Resource res : Iterators.loop(model.listSubjectsWithProperty(typeProp , resourceType))) {
			if (res.isAnon()) {
				continue;
			}
			for (Property prop : labelPropertyProps) {
				for (RDFNode node : Iterators.loop(model.listObjectsOfProperty(res, prop))) {
					String label = getNodeValue(node);
					trie.addEntry(label, res);
					nEntries++;
				}
			}
		}
	}
	logger.info("Entries: " + nEntries);
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:24,代码来源:RDFProjector.java

示例4: generateDocuments

import java.util.logging.Logger; //导入方法依赖的package包/类
private void generateDocuments(Logger logger, EvaluationContext evalCtx, Corpus corpus, Set<String> classes, Document docList) throws XPathExpressionException, IOException, SAXException, TransformerFactoryConfigurationError {
	logger.info("generating HTML documents");
	Element docListUL = XMLUtils.evaluateElement(XPATH_DOCUMENT_LIST, docList);
	Document docSkel = createDocumentSkeleton();
	Iterator<fr.inra.maiage.bibliome.alvisnlp.core.corpus.Document> docIt = documentIterator(evalCtx, corpus);
	fr.inra.maiage.bibliome.alvisnlp.core.corpus.Document prev = null;
	fr.inra.maiage.bibliome.alvisnlp.core.corpus.Document next = docIt.hasNext() ? docIt.next() : null;
	while (next != null) {
		fr.inra.maiage.bibliome.alvisnlp.core.corpus.Document doc = next;
		addDocumentListItem(docList, docListUL, doc);
		next = docIt.hasNext() ? docIt.next() : null;
		Document xmlDoc = createDocument(docSkel, doc, prev, next);
		HTMLBuilderFragmentTagIterator frit = new HTMLBuilderFragmentTagIterator(this, classes);
		for (Section sec : Iterators.loop(sectionIterator(evalCtx, doc))) {
			createSection(xmlDoc, sec, frit);
		}
		writeXHTMLDocument(xmlDoc, doc.getId());
		prev = doc;
	}
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:21,代码来源:QuickHTML.java

示例5: 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);
   	int n = 0;
       for (Section sec : Iterators.loop(sectionIterator(evalCtx, corpus))) {
           Matcher matcher = getPattern().matcher(sec.getContents());
           Layer layer = sec.ensureLayer(getTargetLayerName());
           while (matcher.find()) {
           	n++;
               new Annotation(this, layer, matcher.start(), matcher.end());
           }
       }
       if (n == 0) {
       	logger.warning("found no matches");
       }
       else {
       	logger.info("found " + n + " matches");
       }
   }
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:21,代码来源:RegExp.java

示例6: process

import java.util.logging.Logger; //导入方法依赖的package包/类
public void process(PlanBuilder planBuilder) {
	ProcessingContext<Corpus> processingContext = getProcessingContext();
	Timer<TimerCategory> timer = processingContext.getTimer();
	timer.start();
	try {
		Logger logger = getLogger(processingContext);
		logger.info("result identifier: " + id);
		Sequence<Corpus> plan = planBuilder.buildPlan(this);
		planBuilder.setParams(this, plan);
		planBuilder.check(plan);
		addStatus(RunStatus.STARTED, "", false);
		plan.init(processingContext);
		processingContext.processCorpus(plan, new Corpus());
		addStatus(RunStatus.SUCCESS, "", true);
	}
	catch (Exception e) {
		addStatus(RunStatus.FAILURE, "", true);
	}
       finally {
       	timer.stop();
       }
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:23,代码来源:Run.java

示例7: 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

示例8: postman

import java.util.logging.Logger; //导入方法依赖的package包/类
@Test 
public void postman(){

    try {              
        Process process = Runtime.getRuntime().exec("/paseos-01-prueba-fotos");
        InputStream inputStream = process.getInputStream();
        BufferedReader bf= new BufferedReader(new InputStreamReader(inputStream));
        String line="";
        String ln;
        Logger log=Logger.getAnonymousLogger();
        
        while ((ln=bf.readLine()) != null) {
           log.info(ln);
            line=line.concat(ln);
        }
            
        inputStream.close();
        bf.close();
    } catch (IOException ioe) {
        ioe.printStackTrace();
    }
}
 
开发者ID:Uniandes-ISIS2603-backup,项目名称:201710-paseos_01,代码行数:23,代码来源:FotosTestIntegracion.java

示例9: testInitialization

import java.util.logging.Logger; //导入方法依赖的package包/类
@Test
public void testInitialization()
{
    MemoryDbHsql.getInstance().initializeMemoryDB();

    if (MemoryDbHsql.getInstance().getState() != 1)
    {
        Assert.fail("server was not running");
    }

    MemoryDbHsql.getInstance().shutdownMemoryDb();
    int state = MemoryDbHsql.getInstance().getState();
    if (state != 16)
    {
        Logger log = Logger.getLogger(this.getClass().getName());
        log.info("Memory HQL DB state was " + state);
        Assert.fail("server was running although asked to stop it");
    }
}
 
开发者ID:FINRAOS,项目名称:MegaSparkDiff,代码行数:20,代码来源:MemoryDbHsqlTest.java

示例10: removeOldSections

import java.util.logging.Logger; //导入方法依赖的package包/类
private static void removeOldSections(Logger logger, Map<Element,Element> map) {
	int n = 0;
	for (Map.Entry<Element,Element> e : map.entrySet()) {
		Section oldSec = DownCastElement.toSection(e.getKey());
		if (oldSec != null) {
			Document oldDoc = oldSec.getDocument();
			oldDoc.removeSection(oldSec);
			n++;
		}
	}
	logger.info("removed " + n + " sections");
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:13,代码来源:RemoveContents.java

示例11: logFinished

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
protected void logFinished(Logger logger, Corpus corpus) {
	if (!noProcess) {
		logger.info("annotations: " + corpus.countAnnotations());
		logger.info("postings: " + corpus.countPostings());
	}
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:8,代码来源:AlvisNLP.java

示例12: readNodes

import java.util.logging.Logger; //导入方法依赖的package包/类
/**
 * Reads a NCBI nodes.dmp file.
 * @param logger
 * @param file
 * @param size
 * @throws IOException
 * @throws InvalidFileLineEntry
 */
public void readNodes(Logger logger, File file, int size) throws IOException, InvalidFileLineEntry {
	logger.info("reading nodes file: " + file.getCanonicalPath());
	NodesFileLines fl = new NodesFileLines();
	fl.setLogger(logger);
	int[] parent = new int[size];
	fl.process(file, DmpFileLines.CHARSET, parent);
	for (Taxon taxon : taxa.values()) {
		int taxid = taxon.getTaxid();
		int parentId = parent[taxid];
		taxon.setParent(taxa.get(taxid == parentId ? null : parentId));
	}
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:21,代码来源:NCBITaxonomy.java

示例13: getCorpus

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
  protected Corpus getCorpus(Logger logger) throws IOException {
Corpus result = createCorpus(logger);
      for (Pair<String,String> f : corpusFeatures) {
      	logger.info("setting corpus feature " + f.first + " = " + f.second);
      	result.addFeature(f.first, f.second);
      }
      return result;
  }
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:10,代码来源:AlvisNLP.java

示例14: 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);

	D dict = createDictionary(ctx);
	try {
		Timer<TimerCategory> fillTimer = getTimer(ctx, "load-dictionary", TimerCategory.LOAD_RESOURCE, true);
		fillDictionary(ctx, corpus, dict);
		fillTimer.stop();
		logger.finer("dictionary weight: " + dict.countKeys() + " keys, " + dict.keyLength() + " key length, " + dict.countValues() + " values, " + dict.countStates() + " states");
		Matcher<T> matcher = new Matcher<T>(subject.isCharPos(), logger.isLoggable(Level.FINER), dict, subject.getStartFilter(), subject.getEndFilter());

		logger.info("searching");
		int n = 0;
		for (Section sec : Iterators.loop(sectionIterator(evalCtx, corpus))) {
			matcher.reset();
			subject.match(sec, dict, matcher);
			Layer targetLayer = sec.ensureLayer(targetLayerName );
			for (Match<T> m : matcher.getMatches()) {
				Annotation a = new Annotation(this, targetLayer, m.getStart(), m.getEnd());
				for (T entry : m.getState().getValues())
					handleEntryValues(ctx, dict, a, entry);
				n++;
			}
		}
		if (n == 0) {
			logger.warning("found no matches");
		}
		else {
			logger.info("found " + n + " matches");
		}
		logger.finer("match weight: " + matcher.getVisitedStatesCount() + " visited states");
	}
	catch (Exception e) {
		rethrow(e);
	}
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:39,代码来源:Projector.java

示例15: handle

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
public String handle(ExecutionContext context) {
  Object[] tweetParameters = context.getParameters();
  String message = (String) tweetParameters[0];
  Logger fbLogger = (Logger) tweetParameters[2];
  fbLogger.info(message);
  return null;
}
 
开发者ID:OpenLiberty,项目名称:sample-acmegifts,代码行数:9,代码来源:NotificationFallbackHandler.java


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