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


Java Logger.fine方法代码示例

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


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

示例1: run

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
public void run() {
    try {
        while (goOn) {
            Logger l;
            int barcount = getBarCount();
            for (int i=0; i < LCOUNT ; i++) {
                l = Logger.getLogger("foo.bar"+barcount+".l"+nextLogger.incrementAndGet());
                l.fine("I'm fine");
                if (!goOn) break;
                Thread.sleep(1);
            }
        }
    } catch (InterruptedException | RuntimeException x ) {
        fail(x);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:TestLogConfigurationDeadLockWithConf.java

示例2: lookupUsingOSGiServiceLoader

import java.util.logging.Logger; //导入方法依赖的package包/类
static Object lookupUsingOSGiServiceLoader(String factoryId, Logger logger) {

        try {
            // Use reflection to avoid having any dependendcy on ServiceLoader class
            Class serviceClass = Class.forName(factoryId);
            Class target = Class.forName(OSGI_SERVICE_LOADER_CLASS_NAME);
            Method m = target.getMethod(OSGI_SERVICE_LOADER_METHOD_NAME, Class.class);
            Iterator iter = ((Iterable) m.invoke(null, serviceClass)).iterator();
            if (iter.hasNext()) {
                Object next = iter.next();
                logger.fine("Found implementation using OSGi facility; returning object [" +
                        next.getClass().getName() + "].");
                return next;
            } else {
                return null;
            }
        } catch (IllegalAccessException |
                InvocationTargetException |
                ClassNotFoundException |
                NoSuchMethodException ignored) {

            logger.log(Level.FINE, "Unable to find from OSGi: [" + factoryId + "]", ignored);
            return null;
        }
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:ServiceLoaderUtil.java

示例3: interceptMethodInvocation

import java.util.logging.Logger; //导入方法依赖的package包/类
@AroundInvoke
public Object interceptMethodInvocation(InvocationContext invocationContext) throws Exception {

    final String methodName = invocationContext.getMethod().getName();
    final String className = invocationContext.getTarget().getClass().getName();

    Logger logger = Logger.getLogger(className);

    final long timeBeforeMethodInvocation;
    final long timeAfterMethodInvocation;
    final long millis;
    logger.entering(className, methodName);
    timeBeforeMethodInvocation = System.currentTimeMillis();

    try {
        return invocationContext.proceed();
    } finally {
        timeAfterMethodInvocation = System.currentTimeMillis();
        millis = timeAfterMethodInvocation - timeBeforeMethodInvocation;
        logger.fine("Method took -> " + millis + " millis to be executed!");
        logger.exiting(className, methodName);
    }
}
 
开发者ID:harperkej,项目名称:store-app-ee,代码行数:24,代码来源:LoggingInterceptor.java

示例4: execute

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
public void execute(ExecutionUnit unit) throws OperatorException {
	Logger logger = unit.getEnclosingOperator().getLogger();
	if (logger.isLoggable(Level.FINE)) {
		logger.fine("Executing subprocess " + unit.getEnclosingOperator().getName() + "." + unit.getName()
				+ ". Execution order is: " + unit.getOperators());
	}
	Enumeration<Operator> opEnum = unit.getOperatorEnumeration();
	while (opEnum.hasMoreElements()) {
		// for (Operator operator : unit.getOperators()) {
		Operator operator = opEnum.nextElement();
		operator.execute();
		operator.freeMemory();
	}

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:17,代码来源:SimpleUnitExecutor.java

示例5: processOutput

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
public void processOutput(BufferedReader out, BufferedReader err) throws ModuleException {
	try {
		Logger logger = getLogger(ctx);
		logger.fine("geniatagger standard error:");
		while (true) {
			String line = err.readLine();
			if (line == null)
				break;
			logger.fine("    " + line);
		}
		logger.fine("end of geniatagger standard error");
	}
	catch (FileNotFoundException fnfe) {
		rethrow(fnfe);
	}
	catch (IOException ioe) {
		rethrow(ioe);
	}
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:21,代码来源:GeniaTagger.java

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

示例7: run

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
public void run() {
    while (goOn) {
        try {
            if (Math.random() > CONFSYNCTHRESHOLD) {
                // calling reset while holding a lock can increase
                // deadlock probability...
                synchronized(fakeConfExternalLock()) {
                    LogManager.getLogManager().reset();
                }
            } else {
                LogManager.getLogManager().reset();
            }
            Logger blah = Logger.getLogger(BLAH);
            blah.setLevel(Level.FINEST);
            blah.fine(BLAH);
            resetCount.incrementAndGet();
            pause(1);
        } catch (Exception x) {
            fail(x);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:TestConfigurationLock.java

示例8: 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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:TestIsLoggable.java

示例9: processOutput

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

示例10: log

import java.util.logging.Logger; //导入方法依赖的package包/类
/**
 * Log msg with FINE level or dump a stack if the logger has FINEST level.
 *
 * @param logger
 * @param msg message to log
 */
public static void log(Logger logger, String msg) {
    if (logger.isLoggable(Level.FINEST)) {
        logger.log(Level.INFO, "Cause of " + msg, new Exception());
    } else {
        logger.fine(msg);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ViewUtils.java

示例11: mergeAdjudications

import java.util.logging.Logger; //导入方法依赖的package包/类
void mergeAdjudications(Logger logger) {
	List<AnnotationSet> headDependencies = getHeadDependencies();
	if (headDependencies.size() != 2) {
		throw new RuntimeException("not enough head dependencies");
	}
	logger.fine("updating annotation references");
	updateReferences(headDependencies);
	logger.fine("auto-adjudicating " + toString());
	Iterator<AnnotationSet> asit = headDependencies.iterator();
	AnnotationSet aset1 = asit.next();
	AnnotationSet aset2 = asit.next();
	Map<String,String> forwardSources = buildForwardSources();
	logger.fine("  forward sources: " + forwardSources.size());
	MergeLog mergeLog = new MergeLog(logger);
	AnnotationMerger<TextBound> textBoundMerger = new TextBoundMerger(mergeLog, forwardSources);
	textBoundMerger.merge(aset1, aset2, true);
	mergeLog.report("text-bound");
	AnnotationMerger<Relation> relationMerger = new RelationMerger(mergeLog, forwardSources);
	AnnotationMerger<Group> groupMerger = new GroupMerger(mergeLog, forwardSources);
	boolean firstPass = true;
	while (true) {
		mergeLog.reset();
		boolean proceed = relationMerger.merge(aset1, aset2, firstPass);
		mergeLog.report("relation");
		mergeLog.reset();
		proceed = proceed | groupMerger.merge(aset1, aset2, firstPass); // non short-circuit "or"
		mergeLog.report("group");
		if (proceed) {
			logger.finer("  another round...");
			firstPass = false;
		}
		else {
			break;
		}
	}
	Collection<String> unmatchedIds = buildUnmatchedIds();
	aset1.logStillNeedAdjudication(logger, forwardSources, unmatchedIds);
	aset2.logStillNeedAdjudication(logger, forwardSources, unmatchedIds);
	mergeLog.reportByType();
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:41,代码来源:AnnotationSet.java

示例12: execute

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
public void execute(ExecutionUnit unit) throws OperatorException {
  Logger logger = unit.getEnclosingOperator().getLogger();
  if (logger.isLoggable(Level.FINE)) {
    logger.fine("Executing subprocess " + unit.getEnclosingOperator().getName() + "." + unit.getName()
            + ". Execution order is: " + unit.getOperators());
  }

  if (remote.isRemote(unit)) {
    boolean runnable = validateRemote(unit, ValidationMode.STRICT());
    if (runnable) {
      JobStatus status = remote.execute(unit);
      RemoteResultDisplay display = RapidMinerGUI.getMainFrame().getRemoteResultDisplay();
      boolean shouldSwitchPerspective = !OperatorService.isRapidGUITestMode();
      display.addJobStatus(status, shouldSwitchPerspective);
      final RemoteResultOverview overview = display.getOverview();

      // Scroll the view.
      SwingUtilities.invokeLater(new Runnable() {

        @Override
        public void run() {
          Rectangle visibleRect = overview.getVisibleRect();
          visibleRect.y = overview.getHeight() - visibleRect.height;
          overview.scrollRectToVisible(visibleRect);
        }
      });
    }
  } else if (remote.isLocal(unit)) {
      // fallback to simple local mode
      simple.execute(unit);
  } else {
    // mix of remote and local, can't execute now
    throw new RuntimeException("can not mix remote operator with local one");
  }
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:37,代码来源:MidasUnitExecutor.java

示例13: logStillNeedAdjudication

import java.util.logging.Logger; //导入方法依赖的package包/类
private void logStillNeedAdjudication(Logger logger, Map<String,String> forwardSources, Collection<String> unmatchedIds) {
	int n = 0;
	logger.fine("still need to be adjudicated (" + user + "):");
	for (AlvisAEAnnotation annot : annotations.values()) {
		String id = annot.getId();
		if (forwardSources.containsKey(id) || unmatchedIds.contains(id)) {
			continue;
		}
		logger.finer("  " + annot);
		n++;
	}
	logger.fine("  total: " + n);
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:14,代码来源:AnnotationSet.java

示例14: processOutput

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

示例15: process

import java.util.logging.Logger; //导入方法依赖的package包/类
@Override
public void process(ProcessingContext<Corpus> ctx, Corpus corpus) throws ModuleException {
   	MapperResolvedObjects resObj = getResolvedObjects();
   	Logger logger = getLogger(ctx);
	EvaluationContext evalCtx = new EvaluationContext(logger);
   	Timer<TimerCategory> dictTimer = getTimer(ctx, "load-dictionary", TimerCategory.LOAD_RESOURCE, true);
   	DefaultMap<String,List<T>> mapping = new DefaultArrayListHashMap<String,T>();
   	fillMapping(mapping, ctx, corpus);
   	dictTimer.stop();
   	int n = 0;
   	int m = 0;
   	Timer<TimerCategory> mapTimer = getTimer(ctx, "map", TimerCategory.MODULE, false);
   	Timer<TimerCategory> handleTimer = getTimer(ctx, "handle", TimerCategory.MODULE, false);    	
   	for (Element elt : Iterators.loop(resObj.target.evaluateElements(evalCtx, corpus))) {
   		++n;
   		mapTimer.start();
   		String candidateKey = resObj.form.evaluateString(evalCtx, elt);
   		if (ignoreCase)
   			candidateKey = candidateKey.toLowerCase();
   		List<T> values = operator.getMatches(mapping, candidateKey);
   		mapTimer.stop();
   		if (values.isEmpty()) {
   			continue;
   		}
   		++m;
   		handleTimer.start();
   		for (T v : values) {
   			handleMatch(elt, v);
   		}
   		handleTimer.stop();
   	}
       if (n == 0) {
       	logger.warning("no annotations visited");
       }
       else if (m == 0) {
       	logger.warning(String.format("no annotations mapped (%d visited)", n));
       }
       else {
       	logger.fine(String.format("mapped %d/%d annotations", m, n));
       }
   }
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:42,代码来源:Mapper.java


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