java.util.logging.Logger.fine()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(15.1k)|赞(0)|评价(0)|浏览(314)

本文整理了Java中java.util.logging.Logger.fine()方法的一些代码示例,展示了Logger.fine()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.fine()方法的具体详情如下:
包路径:java.util.logging.Logger
类名称:Logger
方法名:fine

Logger.fine介绍

[英]Log a FINE message.

If the logger is currently enabled for the FINE message level then the given message is forwarded to all the registered output Handler objects.
[中]记录一条好消息。
如果记录器当前已启用精细消息级别,则给定消息将转发到所有已注册的输出处理程序对象。

代码示例

代码示例来源:origin: jenkinsci/jenkins

  1. @Override
  2. public boolean hasPermission(@Nonnull Authentication a, Permission permission) {
  3. if(a==SYSTEM) {
  4. if(LOGGER.isLoggable(FINE))
  5. LOGGER.fine("hasPermission("+a+","+permission+")=>SYSTEM user has full access");
  6. return true;
  7. }
  8. Boolean b = _hasPermission(a,permission);
  9. if(LOGGER.isLoggable(FINE))
  10. LOGGER.fine("hasPermission("+a+","+permission+")=>"+(b==null?"null, thus false":b));
  11. if(b==null) b=false; // default to rejection
  12. return b;
  13. }

代码示例来源:origin: 4thline/cling

  1. @Override
  2. public void success(ActionInvocation invocation) {
  3. log.fine("Port mapping added: " + pm);
  4. activeForService.add(pm);
  5. }

代码示例来源:origin: jenkinsci/jenkins

  1. void migrateUsers(UserIdMapper mapper) throws IOException {
  2. LOGGER.fine("Beginning migration of users to userId mapping.");
  3. Map<String, File> existingUsers = scanExistingUsers();
  4. for (Map.Entry<String, File> existingUser : existingUsers.entrySet()) {
  5. File newDirectory = mapper.putIfAbsent(existingUser.getKey(), false);
  6. LOGGER.log(Level.INFO, "Migrating user '" + existingUser.getKey() + "' from 'users/" + existingUser.getValue().getName() + "/' to 'users/" + newDirectory.getName() + "/'");
  7. Files.move(existingUser.getValue().toPath(), newDirectory.toPath(), StandardCopyOption.REPLACE_EXISTING);
  8. }
  9. mapper.save();
  10. LOGGER.fine("Completed migration of users to userId mapping.");
  11. }

代码示例来源:origin: 4thline/cling

  1. protected void addParsedValue(UpnpHeader.Type type, UpnpHeader value) {
  2. if (log.isLoggable(Level.FINE))
  3. log.fine("Adding parsed header: " + value);
  4. List<UpnpHeader> list = parsedHeaders.get(type);
  5. if (list == null) {
  6. list = new LinkedList<>();
  7. parsedHeaders.put(type, list);
  8. }
  9. list.add(value);
  10. }

代码示例来源:origin: stanfordnlp/CoreNLP

  1. protected void setGroupStart(int bid, int captureGroupId, int curPosition)
  2. {
  3. if (captureGroupId >= 0) {
  4. Map<Integer,MatchedGroup> matchedGroups = getMatchedGroups(bid, true);
  5. MatchedGroup mg = matchedGroups.get(captureGroupId);
  6. if (mg != null) {
  7. // This is possible if we have patterns like "( ... )+" in which case multiple nodes can match as the subgroup
  8. // We will match the first occurrence and use that as the subgroup (Java uses the last match as the subgroup)
  9. logger.fine("Setting matchBegin=" + curPosition + ": Capture group " + captureGroupId + " already exists: " + mg);
  10. }
  11. matchedGroups.put(captureGroupId, new MatchedGroup(curPosition, -1, null));
  12. }
  13. }

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

  1. LOGGER.fine("Detaching triangle.");
  2. if (triangleIndexes.length != 3) {
  3. throw new IllegalArgumentException("Cannot detach triangle with that does not have 3 indexes!");
  4. if (!edgeRemoved[i]) {
  5. indexes.findPath(indexesPairs[i][0], indexesPairs[i][1], path);
  6. if (path.size() == 0) {
  7. indexes.findPath(indexesPairs[i][1], indexesPairs[i][0], path);
  8. if (path.size() == 0) {
  9. throw new IllegalStateException("Triangulation failed. Cannot find path between two indexes. Please apply triangulation in Blender as a workaround.");
  10. if (detachedFaces.size() == 0 && path.size() < indexes.size()) {
  11. Integer[] indexesSublist = path.toArray(new Integer[path.size()]);
  12. detachedFaces.add(new Face(indexesSublist, smooth, materialNumber, meshHelper.selectUVSubset(this, indexesSublist), meshHelper.selectVertexColorSubset(this, indexesSublist), temporalMesh));
  13. for (int j = 0; j < path.size() - 1; ++j) {
  14. indexes.removeEdge(path.get(j), path.get(j + 1));

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

  1. LOGGER.fine("Triangulating face.");
  2. assert indexes.size() >= 3 : "Invalid indexes amount for face. 3 is the required minimum!";
  3. triangulatedFaces = new ArrayList<IndexesLoop>(indexes.size() - 2);
  4. while (facesToTriangulate.size() > 0 && warning == TriangulationWarning.NONE) {
  5. Face face = facesToTriangulate.remove(0);
  6. triangulatedFaces.add(face.getIndexes().clone());
  7. } else {
  8. int previousIndex1 = -1, previousIndex2 = -1, previousIndex3 = -1;
  9. triangulatedFaces.add(new IndexesLoop(indexes));
  10. LOGGER.log(Level.WARNING, "Errors occured during face triangulation: {0}. The face will be triangulated with the most direct algorithm, but the results might not be identical to blender.", e.getLocalizedMessage());
  11. warning = TriangulationWarning.UNKNOWN;
  12. indexes[1] = this.getIndex(i);
  13. indexes[2] = this.getIndex(i + 1);
  14. triangulatedFaces.add(new IndexesLoop(indexes));

代码示例来源:origin: 4thline/cling

  1. public Resource[] getResources(Device device) throws ValidationException {
  2. if (!device.isRoot()) return null;
  3. Set<Resource> resources = new HashSet<>();
  4. List<ValidationError> errors = new ArrayList<>();
  5. log.fine("Discovering local resources of device graph");
  6. Resource[] discoveredResources = device.discoverResources(this);
  7. for (Resource resource : discoveredResources) {
  8. log.finer("Discovered: " + resource);
  9. if (!resources.add(resource)) {
  10. log.finer("Local resource already exists, queueing validation error");
  11. errors.add(new ValidationError(
  12. getClass(),
  13. "resources",
  14. "Local URI namespace conflict between resources of device: " + resource
  15. ));
  16. }
  17. }
  18. if (errors.size() > 0) {
  19. throw new ValidationException("Validation of device graph failed, call getErrors() on exception", errors);
  20. }
  21. return resources.toArray(new Resource[resources.size()]);
  22. }

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

  1. loadedFeatures.objects.add(object);
  2. loadedFeatures.lights.add(((LightNode) object).getLight());
  3. } else if (object instanceof CameraNode && ((CameraNode) object).getCamera() != null) {
  4. loadedFeatures.cameras.add(((CameraNode) object).getCamera());
  5. LOGGER.fine("Only image textures can be loaded as unlinked assets. Generated textures will be applied to an existing object.");
  6. LOGGER.fine("Loading unlinked animations is not yet supported!");
  7. break;
  8. default:
  9. LOGGER.log(Level.FINEST, "Ommiting the block: {0}.", block.getCode());
  10. LOGGER.fine("Baking constraints after every feature is loaded.");
  11. ConstraintHelper constraintHelper = blenderContext.getHelper(ConstraintHelper.class);
  12. constraintHelper.bakeConstraints(blenderContext);
  13. LOGGER.fine("Loading scenes and attaching them to the root object.");
  14. for (FileBlockHeader sceneBlock : loadedFeatures.sceneBlocks) {
  15. loadedFeatures.scenes.add(this.toScene(sceneBlock.getStructure(blenderContext), blenderContext));
  16. LOGGER.fine("Creating the root node of the model and applying loaded nodes of the scene and loaded features to it.");
  17. Node modelRoot = new Node(blenderKey.getName());
  18. for (Node scene : loadedFeatures.scenes) {
  19. LOGGER.fine("Setting loaded content as user data in resulting sptaial.");
  20. Map<String, Map<String, Object>> linkedData = new HashMap<String, Map<String, Object>>();

代码示例来源:origin: org.netbeans.api/org-openide-util

  1. Collection<? extends ActionMap> ams = result.allInstances();
  2. if (err.isLoggable(Level.FINE)) {
  3. err.fine("changed maps : " + ams); // NOI18N
  4. err.fine("previous maps: " + actionMaps); // NOI18N
  5. if (ams.size() == actionMaps.size()) {
  6. boolean theSame = true;
  7. int i = 0;
  8. tempActionMaps.add(new WeakReference<ActionMap>(actionMap));
  9. if (err.isLoggable(Level.FINE)) {
  10. err.fine("clearActionPerformers"); // NOI18N

代码示例来源:origin: jenkinsci/jenkins

  1. if (LOGGER.isLoggable(Level.FINE)) {
  2. LOGGER.fine("Determining visibility of " + d + " in contexts of type " + contextClass);
  3. if (LOGGER.isLoggable(Level.FINER)) {
  4. LOGGER.finer("Querying " + f + " for visibility of " + d + " in type " + contextClass);
  5. if (LOGGER.isLoggable(Level.CONFIG)) {
  6. LOGGER.config("Filter " + f + " hides " + d + " in contexts of type " + contextClass);
  7. LOGGER.log(Level.WARNING,
  8. "Encountered error while processing filter " + f + " for contexts of type " + contextClass, e);
  9. throw e;
  10. } catch (Throwable e) {
  11. LOGGER.log(logLevelFor(f), "Uncaught exception from filter " + f + " for context of type " + contextClass, e);
  12. continue OUTER; // veto-ed. not shown
  13. r.add(d);

代码示例来源:origin: jenkinsci/jenkins

  1. if (node == null)
  2. continue; // this computer is gone
  3. byName.put(node.getNodeName(),c);
  4. long start = System.currentTimeMillis();
  5. updateComputer(s, byName, used, automaticSlaveLaunch);
  6. if (LOG_STARTUP_PERFORMANCE && LOGGER.isLoggable(Level.FINE)) {
  7. LOGGER.fine(String.format("Took %dms to update node %s",
  8. System.currentTimeMillis() - start, s.getNodeName()));

代码示例来源:origin: igniterealtime/Smack

  1. if (LOGGER.isLoggable(Level.FINE)) {
  2. String logMessage = "Resolved SRV RR for " + srvDomain + ":";
  3. for (SRVRecord r : srvRecords)
  4. logMessage += " " + r;
  5. LOGGER.fine(logMessage);
  6. addresses.add(hostAddress);

代码示例来源:origin: stanfordnlp/CoreNLP

  1. protected static void reportWeights(LinearClassifier<String, String> classifier, String classLabel) {
  2. if (classLabel != null) logger.fine("CLASSIFIER WEIGHTS FOR LABEL " + classLabel);
  3. Map<String, Counter<String>> labelsToFeatureWeights = classifier.weightsAsMapOfCounters();
  4. List<String> labels = new ArrayList<>(labelsToFeatureWeights.keySet());
  5. Collections.sort(labels);
  6. for (String label: labels) {
  7. Counter<String> featWeights = labelsToFeatureWeights.get(label);
  8. List<Pair<String, Double>> sorted = Counters.toSortedListWithCounts(featWeights);
  9. StringBuilder bos = new StringBuilder();
  10. bos.append("WEIGHTS FOR LABEL ").append(label).append(':');
  11. for (Pair<String, Double> feat: sorted) {
  12. bos.append(' ').append(feat.first()).append(':').append(feat.second()+"\n");
  13. }
  14. logger.fine(bos.toString());
  15. }
  16. }

代码示例来源:origin: jenkinsci/jenkins

  1. private void scanFile(File log) {
  2. LOGGER.fine("Scanning "+log);
  3. try (Reader rawReader = new FileReader(log);
  4. BufferedReader r = new BufferedReader(rawReader)) {
  5. if (!findHeader(r))
  6. return;
  7. // we should find a memory mapped file for secret.key
  8. String secretKey = getSecretKeyFile().getAbsolutePath();
  9. String line;
  10. while ((line=r.readLine())!=null) {
  11. if (line.contains(secretKey)) {
  12. files.add(new HsErrPidFile(this,log));
  13. return;
  14. }
  15. }
  16. } catch (IOException e) {
  17. // not a big enough deal.
  18. LOGGER.log(Level.FINE, "Failed to parse hs_err_pid file: " + log, e);
  19. }
  20. }

代码示例来源:origin: stanfordnlp/CoreNLP

  1. public List<String> annotateMulticlass(List<Datum<String, String>> testDatums) {
  2. List<String> predictedLabels = new ArrayList<>();
  3. for (Datum<String, String> testDatum: testDatums) {
  4. String label = classOf(testDatum, null);
  5. Counter<String> probs = probabilityOf(testDatum);
  6. double prob = probs.getCount(label);
  7. StringWriter sw = new StringWriter();
  8. PrintWriter pw = new PrintWriter(sw);
  9. if (logger.isLoggable(Level.FINE)) {
  10. justificationOf(testDatum, pw, label);
  11. }
  12. logger.fine("JUSTIFICATION for label GOLD:" + testDatum.label() + " SYS:" + label + " (prob:" + prob + "):\n"
  13. + sw.toString() + "\nJustification done.");
  14. predictedLabels.add(label);
  15. if(! testDatum.label().equals(label)){
  16. logger.info("Classification: found different type " + label + " for relation: " + testDatum);
  17. } else{
  18. logger.info("Classification: found similar type " + label + " for relation: " + testDatum);
  19. }
  20. }
  21. return predictedLabels;
  22. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Persists a list of installing plugins; this is used in the case Jenkins fails mid-installation and needs to be restarted
  3. * @param installingPlugins
  4. */
  5. public static synchronized void persistInstallStatus(List<UpdateCenterJob> installingPlugins) {
  6. File installingPluginsFile = getInstallingPluginsFile();
  7. if(installingPlugins == null || installingPlugins.isEmpty()) {
  8. installingPluginsFile.delete();
  9. return;
  10. }
  11. LOGGER.fine("Writing install state to: " + installingPluginsFile.getAbsolutePath());
  12. Map<String,String> statuses = new HashMap<String,String>();
  13. for(UpdateCenterJob j : installingPlugins) {
  14. if(j instanceof InstallationJob && j.getCorrelationId() != null) { // only include install jobs with a correlation id (directly selected)
  15. InstallationJob ij = (InstallationJob)j;
  16. InstallationStatus status = ij.status;
  17. String statusText = status.getType();
  18. if(status instanceof Installing) { // flag currently installing plugins as pending
  19. statusText = "Pending";
  20. }
  21. statuses.put(ij.plugin.name, statusText);
  22. }
  23. }
  24. try {
  25. String installingPluginXml = new XStream().toXML(statuses);
  26. FileUtils.write(installingPluginsFile, installingPluginXml);
  27. } catch (IOException e) {
  28. LOGGER.log(SEVERE, "Failed to save " + installingPluginsFile.getAbsolutePath(), e);
  29. }
  30. }

代码示例来源:origin: jersey/jersey

  1. if (LOG.isLoggable(Level.FINE)) {
  2. LOG.fine("Skipping empty inline tag of @response.param in method "
  3. + methodDoc.qualifiedName() + ": " + tagName);
  4. break;
  5. default:
  6. LOG.warning("Unknown inline tag of @response.param in method "
  7. + methodDoc.qualifiedName() + ": " + tagName
  8. + " (value: " + tagText + ")");
  9. responseDoc.getWadlParams().add(wadlParam);
  10. representationDoc.setDoc(tag.text());
  11. } else {
  12. LOG.warning("Unknown response representation tag " + tag.name());
  13. responseDoc.getRepresentations().add(representationDoc);

代码示例来源:origin: 4thline/cling

  1. public LocalGENASubscription(LocalService service,
  2. Integer requestedDurationSeconds, List<URL> callbackURLs) throws Exception {
  3. super(service);
  4. setSubscriptionDuration(requestedDurationSeconds);
  5. log.fine("Reading initial state of local service at subscription time");
  6. long currentTime = new Date().getTime();
  7. this.currentValues.clear();
  8. Collection<StateVariableValue> values = getService().getManager().getCurrentState();
  9. log.finer("Got evented state variable values: " + values.size());
  10. for (StateVariableValue value : values) {
  11. this.currentValues.put(value.getStateVariable().getName(), value);
  12. if (log.isLoggable(Level.FINEST)) {
  13. log.finer("Read state variable value '" + value.getStateVariable().getName() + "': " + value.toString());
  14. }
  15. // Preserve "last sent" state for future moderation
  16. lastSentTimestamp.put(value.getStateVariable().getName(), currentTime);
  17. if (value.getStateVariable().isModeratedNumericType()) {
  18. lastSentNumericValue.put(value.getStateVariable().getName(), Long.valueOf(value.toString()));
  19. }
  20. }
  21. this.subscriptionId = SubscriptionIdHeader.PREFIX + UUID.randomUUID();
  22. this.currentSequence = new UnsignedIntegerFourBytes(0);
  23. this.callbackURLs = callbackURLs;
  24. }

代码示例来源:origin: 4thline/cling

  1. void maintain() {
  2. if (getDeviceItems().isEmpty()) return;
  3. // Remove expired remote devices
  4. Map<UDN, RemoteDevice> expiredRemoteDevices = new HashMap<>();
  5. for (RegistryItem<UDN, RemoteDevice> remoteItem : getDeviceItems()) {
  6. if (log.isLoggable(Level.FINEST))
  7. log.finest("Device '" + remoteItem.getItem() + "' expires in seconds: "
  8. + remoteItem.getExpirationDetails().getSecondsUntilExpiration());
  9. if (remoteItem.getExpirationDetails().hasExpired(false)) {
  10. expiredRemoteDevices.put(remoteItem.getKey(), remoteItem.getItem());
  11. }
  12. }
  13. for (RemoteDevice remoteDevice : expiredRemoteDevices.values()) {
  14. if (log.isLoggable(Level.FINE))
  15. log.fine("Removing expired: " + remoteDevice);
  16. remove(remoteDevice);
  17. }
  18. // Renew outgoing subscriptions
  19. Set<RemoteGENASubscription> expiredOutgoingSubscriptions = new HashSet<>();
  20. for (RegistryItem<String, RemoteGENASubscription> item : getSubscriptionItems()) {
  21. if (item.getExpirationDetails().hasExpired(true)) {
  22. expiredOutgoingSubscriptions.add(item.getItem());
  23. }
  24. }
  25. for (RemoteGENASubscription subscription : expiredOutgoingSubscriptions) {
  26. if (log.isLoggable(Level.FINEST))
  27. log.fine("Renewing outgoing subscription: " + subscription);
  28. renewOutgoingSubscription(subscription);
  29. }
  30. }

相关文章