List of usage examples for java.util.logging Level FINE
Level FINE
To view the source code for java.util.logging Level FINE.
Click Source Link
From source file:com.bbva.arq.devops.ae.mirrorgate.jenkins.plugin.listener.MirrorGateListenerHelper.java
private void sendBuildExtraData(BuildBuilder builder, TaskListener listener) { List<String> extraUrl = MirrorGateUtils.getURLList(); extraUrl.forEach(u -> {/*from w w w. j av a 2s . c o m*/ MirrorGateResponse response = getMirrorGateService() .sendBuildDataToExtraEndpoints(builder.getBuildData(), u); String msg = "POST to " + u + " succeeded!"; Level level = Level.FINE; if (response.getResponseCode() != HttpStatus.SC_CREATED) { msg = "POST to " + u + " failed with code: " + response.getResponseCode(); level = Level.WARNING; } if (listener != null && level == Level.FINE) { listener.getLogger().println(msg); } LOG.log(level, msg); }); }
From source file:com.ibm.ws.lars.rest.RepositoryRESTResourceLoggingTest.java
@Test public void testCountAssets(@Mocked final Logger logger, @Mocked final UriInfo info, @Mocked SecurityContext sc) throws URISyntaxException, InvalidParameterException { new Expectations() { {/*w w w. j av a 2 s.c o m*/ info.getQueryParameters(false); logger.isLoggable(Level.FINE); result = true; info.getRequestUri(); result = new URI("http://localhost:9085/ma/v1/assets?foo=bar"); logger.fine("countAssets called with query parameters: foo=bar"); } }; getRestResource().countAssets(info, sc); }
From source file:com.google.enterprise.connector.filenet4.Checkpoint.java
public void setTimeAndUuid(JsonField jsonDateField, Date nextCheckpointDate, JsonField jsonUuidField, Id uuid) throws RepositoryException { try {//from w w w . j a va2 s .com String dateString; if (nextCheckpointDate == null) { if (jo.isNull(jsonDateField.toString())) { dateString = null; } else { dateString = jo.getString(jsonDateField.toString()); } } else { Calendar cal = Calendar.getInstance(); cal.setTime(nextCheckpointDate); dateString = Value.calendarToIso8601(cal); } String guid; if (uuid == null) { if (jo.isNull(jsonUuidField.toString())) { guid = null; } else { guid = jo.getString(jsonUuidField.toString()); } } else { guid = uuid.toString(); } jo.put(jsonUuidField.toString(), guid); jo.put(jsonDateField.toString(), dateString); logger.log(Level.FINE, "Set new checkpoint for {0} field to {1}, " + "{2} field to {3}", new Object[] { jsonDateField.toString(), dateString, jsonUuidField.toString(), uuid }); } catch (JSONException e) { throw new RepositoryException("Failed to set JSON values for fields: " + jsonDateField.toString() + " or " + jsonUuidField.toString(), e); } }
From source file:joachimeichborn.geotag.handlers.OpenTracksHandler.java
public static void openTracks(final String aPath, final String[] aFiles, final TracksRepo aTracksRepo) { final Job job = new Job("Reading tracks") { @Override//from w w w. java 2 s . c o m protected IStatus run(final IProgressMonitor aMonitor) { aMonitor.beginTask("Reading " + aFiles.length + " tracks", aFiles.length); int threads = 2 * Runtime.getRuntime().availableProcessors(); logger.fine("Using " + threads + " cores for loading tracks"); final ExecutorService threadPool = Executors.newFixedThreadPool(threads); final List<Future<?>> futures = new LinkedList<>(); for (final String file : aFiles) { final Path trackFile = Paths.get(aPath, file); futures.add(threadPool.submit(new TrackReader(aMonitor, trackFile, aTracksRepo))); } final IStatus status = waitForAllTracksToBeRead(futures); aMonitor.done(); return status; } private IStatus waitForAllTracksToBeRead(final List<Future<?>> futures) { for (final Future<?> future : futures) { try { future.get(); } catch (InterruptedException e) { logger.log(Level.FINE, "Waiting for track to be loaded was interrupted", e); Thread.currentThread().interrupt(); return Status.CANCEL_STATUS; } catch (ExecutionException e) { logger.log(Level.FINE, "Reading track failed", e); Thread.currentThread().interrupt(); return Status.CANCEL_STATUS; } } logger.info("Reading " + futures.size() + " tracks completed"); return Status.OK_STATUS; } }; job.setUser(true); job.schedule(); }
From source file:net.sf.mpaxs.spi.computeHost.StartUp.java
/** * * @param cfg/*from ww w .ja v a 2s . c om*/ */ public StartUp(Configuration cfg) { Settings settings = new Settings(cfg); try { System.setProperty("java.rmi.server.codebase", settings.getCodebase().toString()); Logger.getLogger(StartUp.class.getName()).log(Level.INFO, "RMI Codebase at {0}", settings.getCodebase().toString()); } catch (MalformedURLException ex) { Logger.getLogger(StartUp.class.getName()).log(Level.SEVERE, null, ex); } File policyFile; policyFile = new File(new File(settings.getOption(ConfigurationKeys.KEY_COMPUTE_HOST_WORKING_DIR)), settings.getPolicyName()); if (!policyFile.exists()) { System.out.println("Did not find security policy, will create default one!"); policyFile.getParentFile().mkdirs(); BufferedReader br = new BufferedReader(new InputStreamReader( StartUp.class.getResourceAsStream("/net/sf/mpaxs/spi/computeHost/wideopen.policy"))); try { BufferedWriter bw = new BufferedWriter(new FileWriter(policyFile)); String s = null; while ((s = br.readLine()) != null) { bw.write(s + "\n"); } bw.flush(); bw.close(); br.close(); Logger.getLogger(StartUp.class.getName()).log(Level.INFO, "Using security policy at " + policyFile.getAbsolutePath()); } catch (IOException ex) { Logger.getLogger(StartUp.class.getName()).log(Level.SEVERE, null, ex); } } else { Logger.getLogger(StartUp.class.getName()).log(Level.INFO, "Found existing policy file at " + policyFile.getAbsolutePath()); } System.setProperty("java.security.policy", policyFile.getAbsolutePath()); System.setProperty("java.net.preferIPv4Stack", "true"); if (System.getSecurityManager() == null) { System.setSecurityManager(new SecurityManager()); } Logger.getLogger(StartUp.class.getName()).log(Level.FINE, "Creating host"); Host h = new Host(); Logger.getLogger(StartUp.class.getName()).log(Level.FINE, "Configuring host"); h.configure(cfg); Logger.getLogger(StartUp.class.getName()).log(Level.FINE, "Setting auth token " + settings.getOption(ConfigurationKeys.KEY_AUTH_TOKEN)); String at = settings.getOption(ConfigurationKeys.KEY_AUTH_TOKEN); h.setAuthenticationToken(UUID.fromString(at)); Logger.getLogger(StartUp.class.getName()).log(Level.INFO, "Starting host {0}", settings.getHostID()); h.startComputeHost(); }
From source file:org.cloudfoundry.reconfiguration.tomee.DelegatingPropertiesProvider.java
private ServiceInfo getBoundService() { final Collection<ServiceInfo> serviceInfos = getCloudInstance().getServiceInfos(); final String cfServiceId = extractCloudFoundryServiceId(); for (ServiceInfo serviceInfo : serviceInfos) { if (cfServiceId.equals(serviceInfo.getId())) { if (logger.isLoggable(Level.FINE)) { logger.fine("Found matching ServiceInfo for serviceId " + cfServiceId + ": " + serviceInfo); }/* w ww . j a v a2 s . c om*/ return serviceInfo; } } throw new ConfigurationException("Cannot find ServiceInfo for serviceId: " + cfServiceId); }
From source file:com.twitter.aurora.scheduler.storage.mem.MemTaskStore.java
@Timed("mem_storage_fetch_tasks") @Override/*from w w w . ja va 2s .c om*/ public ImmutableSet<IScheduledTask> fetchTasks(Query.Builder query) { checkNotNull(query); long start = System.nanoTime(); ImmutableSet<IScheduledTask> result = matches(query.get()).toSet(); long durationNanos = System.nanoTime() - start; Level level = (durationNanos >= slowQueryThresholdNanos) ? Level.INFO : Level.FINE; if (LOG.isLoggable(level)) { Long time = Amount.of(durationNanos, Time.NANOSECONDS).as(Time.MILLISECONDS); LOG.log(level, "Query took " + time + " ms: " + query.get()); } return result; }
From source file:org.jax.haplotype.analysis.visualization.SimplePhylogenyTreeImageFactory.java
/** * {@inheritDoc}//from w w w . j av a 2 s .c om */ public BufferedImage createPhylogenyImage(PhylogenyTreeNode phylogenyTree, int imageWidth, int imageHeight) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Creating phylogeny image for: " + phylogenyTree.resolveToSingleStrainLeafNodes(0.0).toNewickFormat()); } BufferedImage bi = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_4BYTE_ABGR); Graphics2D graphics = bi.createGraphics(); graphics.setStroke(LINE_STROKE); graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.setColor(Color.BLACK); this.paintPhylogenyTree(graphics, phylogenyTree, imageWidth, imageHeight); return bi; }
From source file:com.symbian.driver.remoting.master.QueuedExecutor.java
/** * Kill a running test job.//from ww w .j ava2 s . c o m * * @param aTestJobId * int: a job id * @return a reference to the testjob or null if there no * such job. */ public TestJob killJob(int aTestJobId) { runningTestJob.stop(); JobTracker.remove(aTestJobId); JobTracker.getInstance().takeSnapshot(); runningTestJob.setState(TestJob.TERMINATED); takeSnapshot(); LOGGER.log(Level.FINE, "Master: Job " + runningTestJob.getId() + "has been killed."); return runningTestJob; }
From source file:com.github.alexfalappa.nbspringboot.cfgprops.highlighting.UnknownPropsHighlightingTask.java
@Override protected void internalRun(CfgPropsParser.CfgPropsParserResult cfgResult, SchedulerEvent se, Document document, List<ErrorDescription> errors, Severity severity) { logger.fine("Highlighting unknown properties"); final Project prj = Utilities.actionsGlobalContext().lookup(Project.class); if (prj != null) { final SpringBootService sbs = prj.getLookup().lookup(SpringBootService.class); if (sbs != null) { final Map<Integer, Pair<String, String>> propLines = cfgResult.getPropLines(); for (Map.Entry<Integer, Pair<String, String>> entry : propLines.entrySet()) { int line = entry.getKey(); String pName = entry.getValue().first(); ConfigurationMetadataProperty cfgMeta = sbs.getPropertyMetadata(pName); if (cfgMeta == null) { // try to interpret array notation (strip '[index]' from pName) Matcher mArrNot = pArrayNotation.matcher(pName); if (mArrNot.matches()) { cfgMeta = sbs.getPropertyMetadata(mArrNot.group(1)); } else { // try to interpret map notation (see if pName starts with a set of known map props) for (String mapPropertyName : sbs.getMapPropertyNames()) { if (pName.startsWith(mapPropertyName)) { cfgMeta = sbs.getPropertyMetadata(mapPropertyName); break; }//from www . j ava 2s . c o m } } } if (cfgMeta == null) { ErrorDescription errDesc = ErrorDescriptionFactory.createErrorDescription(severity, String.format("Unknown Spring Boot property '%s'", pName), document, line); errors.add(errDesc); } } } } if (!errors.isEmpty()) { logger.log(Level.FINE, "Found {0} unknown properties", errors.size()); } }