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:fitnesse.testsystems.CommandRunner.java
public void asynchronousStart() throws IOException { ProcessBuilder processBuilder = new ProcessBuilder(command); processBuilder.environment().putAll(determineEnvironment()); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Starting process " + asList(command)); }/*from ww w .ja v a 2 s . c o m*/ process = processBuilder.start(); sendCommandStartedEvent(); redirectOutputs(process, executionLogListener); }
From source file:com.joyfulmongo.db.JFMongoCmdUpdate.java
@Override protected JFMongoCmdResult execute() { JFMongoCmdResult result = new JFMongoCmdResult(); List<ContainerObject> childs = findChildObject(updates); for (ContainerObject child : childs) { child.onUpdate(colname, updates); if (child instanceof OpCmd) { OpCmd cmd = (OpCmd) child;//w w w . ja va 2 s . c om Object o = cmd.onCreateOutput(); String key = cmd.getKey(); result.put(key, o); } } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, " OnUpdate=" + updates); } Date now = Utils.getCurrentTime(); updates.put(Constants.Props.updatedAt.toString(), now); JFDBCollection collection = JFDBCollectionFactory.getInstance().getCollection(colname); collection.update(query, updates); result.setUpdatedAt(now); return result; }
From source file:org.vaadin.drone.service.MQTTBridge.java
private void publish(String parentTopic, NavData navData) { Gson b = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss:SSS").create(); JsonObject json = b.toJsonTree(navData).getAsJsonObject(); if (isPublishJson()) { try {//from w w w .ja v a2s .co m mqtt.publish(parentTopic, new MqttMessage(b.toJson(json).getBytes())); Logger.getLogger(MQTTBridge.class.getName()).log(Level.FINE, "MQTT: publish " + parentTopic + "=" + json.toString()); } catch (MqttException ex) { Logger.getLogger(MQTTBridge.class.getName()).log(Level.SEVERE, null, ex); } } else { json.entrySet().stream().forEach(p -> { try { String k = "/" + p.getKey().toUpperCase(); String v = p.getValue().toString(); mqtt.publish(parentTopic + p.getKey(), new MqttMessage(v.getBytes())); Logger.getLogger(MQTTBridge.class.getName()).log(Level.FINE, "MQTT: publish " + parentTopic + k + "=" + v); } catch (MqttException ex) { Logger.getLogger(MQTTBridge.class.getName()).log(Level.SEVERE, null, ex); } }); } }
From source file:com.exquance.jenkins.plugins.HarbormasterHookReceiver.java
/** * Harbormaster sends payload as urlencoded query string <pre>payload=JSON</pre> * @throws IOException//from w ww. j a va2 s .c o m */ public void doIndex(StaplerRequest req) throws IOException { if (req.getRequestURI().contains("/" + HARBORMASTER_HOOK_URL + "/")) { String body = URLDecoder.decode(req.getQueryString()); if (body.startsWith("payload=")) body = body.substring(8); LOGGER.log(Level.FINE, "Received commit hook notification : {0}", body); JSONObject payload = JSONObject.fromObject(body); payloadProcessor.processPayload(payload, req); } else { LOGGER.log(Level.WARNING, "The Jenkins job cannot be triggered. You might not have configured correctly the WebHook on Harbormaster with the last slash `http://<JENKINS-URL>/harbormaster-hook/`"); } }
From source file:com.adr.taskexecutor.ui.TaskExecutorRemote.java
/** Creates new form TaskExecutorRemote */ public TaskExecutorRemote() { initComponents();/*from ww w .j a v a 2s. co m*/ jLoggingLevel.addItem(Level.SEVERE); jLoggingLevel.addItem(Level.WARNING); jLoggingLevel.addItem(Level.INFO); jLoggingLevel.addItem(Level.CONFIG); jLoggingLevel.addItem(Level.FINE); jLoggingLevel.addItem(Level.FINER); jLoggingLevel.addItem(Level.FINEST); jLoggingLevel.addItem(Level.OFF); jLoggingLevel.addItem(Level.ALL); jURL.setText(Configuration.getInstance().getPreference("remote.serverurl", "http://localhost/taskexecutoree/executetask")); jLoggingLevel.setSelectedItem(Level .parse(Configuration.getInstance().getPreference("remote.logginglevel", Level.INFO.toString()))); jTrace.setSelected(Boolean .parseBoolean(Configuration.getInstance().getPreference("remote.trace", Boolean.FALSE.toString()))); jStats.setSelected(Boolean .parseBoolean(Configuration.getInstance().getPreference("remote.stats", Boolean.TRUE.toString()))); }
From source file:net.chrissearle.flickrvote.web.vote.VoteAction.java
public void setSession(Map<String, Object> stringObjectMap) { if (logger.isLoggable(Level.FINE)) { logger.fine("setSession"); }/*from w w w .j ava2 s. c om*/ this.session = stringObjectMap; }
From source file:eu.trentorise.opendata.commons.test.jackson.TodJacksonTester.java
/** * Tests that the provided object can be converted to json and * reconstructed. Also logs the json with the provided logger at FINE level. * * @return the reconstructed object/*from ww w. j a va2s.c om*/ */ public static <T> T testJsonConv(ObjectMapper om, Logger logger, @Nullable T obj) { checkNotNull(om); checkNotNull(logger); T recObj; String json; try { json = om.writeValueAsString(obj); logger.log(Level.FINE, "json = {0}", json); } catch (Exception ex) { throw new RuntimeException("FAILED SERIALIZING!", ex); } try { Object ret = om.readValue(json, obj.getClass()); recObj = (T) ret; } catch (Exception ex) { throw new RuntimeException("FAILED DESERIALIZING!", ex); } assertEquals(obj, recObj); return recObj; }
From source file:com.screenslicer.common.Log.java
public static void exception(Throwable t, String supplementaryMessage) { if (logger == null) { init("screenslicer", true); }/* w w w. j ava 2s .c o m*/ Level level = Level.SEVERE; String packageName = t.getClass().getName(); for (int i = 0; i < chattyClasses.length; i++) { if (packageName.startsWith(chattyClasses[i])) { level = Level.FINE; break; } } String message = t.getMessage(); message = CommonUtil.isEmpty(message) ? "" : message; logger.log(level, "Exception \"" + message + "\" ~ " + (CommonUtil.isEmpty(supplementaryMessage) ? "" : (supplementaryMessage + " ~ ")) + "Stack trace: " + ExceptionUtils.getStackTrace(t)); }
From source file:magma.agent.behavior.complex.RunToBall.java
@Override public void perform(float intensity) { if (currentBehavior == null || currentBehavior.isFinished()) { double ballAngle = Math.toDegrees(worldModel.getBall().getHorizontalDirection()); logger.log(Level.FINE, "runToBall angle: {0}", ballAngle); if (ballAngle > 40) { currentBehavior = behaviors.get(IBehavior.TURN_LEFT_40); } else if (ballAngle < -40) { currentBehavior = behaviors.get(IBehavior.TURN_RIGHT_40); } else {//from w w w. j av a 2 s. c o m currentBehavior = behaviors.get(IBehavior.WALK); } // Calculate whether the straight line between player and ball hits the // goal IThisPlayer thisPlayer = worldModel.getThisPlayer(); IMoveableObject ball = worldModel.getBall(); Vector3D ballPos = ball.getPosition(); Vector3D ownPos = thisPlayer.getPosition(); // double goalDistance = thisPlayer.getDistanceTo(worldModel // .getOtherGoalPosition()); // double ownGoalDistance = thisPlayer.getDistanceTo(worldModel // .getOwnGoalPosition()); Angle ballAngle1 = thisPlayer.getBodyDirectionTo(ballPos); // Angle goalAngle1 = thisPlayer.getBodyDirectionTo(worldModel // .getOtherGoalPosition()); // Angle delta = goalAngle1.subtract(ballAngle1); double ballAngle2 = ballAngle1.degrees(); // double goalAngle = goalAngle1.degrees(); // Calculate the position where the straight line through the player // and // the ball will cross the end of the field double m = 0; double b = 0; // Decide on which goal are we playing and calculate the straight line double x = worldModel.getOtherGoalPosition().getX(); if (x < 0) { // Playing to the left goal m = (ballPos.getY() - ownPos.getY()) / (ballPos.getX() - ownPos.getX()); b = ballPos.getY() - m * ownPos.getX(); } else { // Playing to the right goal m = (ownPos.getY() - ballPos.getY()) / (ownPos.getX() - ballPos.getX()); b = ownPos.getY() - m * ballPos.getX(); } // Calculate the Y point of the goal line where the ball will cross the // line if we perform a straight kick double y = m * x + b; // The straight line will not hit the goal logger.log(Level.FINE, "runToBall2 ballAngle2: {0} y:{1}", new Object[] { ballAngle2, y }); if (y > 0.7 && ballAngle2 < 15) { currentBehavior = behaviors.get(IBehavior.TURN_RIGHT_40); } else if (y < -0.7 && ballAngle2 > -15) { currentBehavior = behaviors.get(IBehavior.TURN_LEFT_40); } else { currentBehavior = behaviors.get(IBehavior.WALK); } currentBehavior.init(); } currentBehavior.perform(intensity); }
From source file:edu.cwru.sepia.runner.SimpleModelEpisodicRunner.java
@Override public void run() { seed = configuration.getInt("RandomSeed", 6); numEpisodes = configuration.getInt("NumEpisodes", 1); episodesPerSave = configuration.getInt("EpisodesPerSave", 0); saveAgents = configuration.getBoolean("SaveAgents", false); SimpleModel model = new SimpleModel(stateCreator.createState(), stateCreator, configuration); File baseDirectory = new File("saves"); baseDirectory.mkdirs();/*from ww w . j a v a2 s . co m*/ env = new Environment(agents, model, seed, configuration); for (int episode = 0; episode < numEpisodes; episode++) { if (logger.isLoggable(Level.FINE)) logger.fine("=======> Starting episode " + episode); try { env.runEpisode(); } catch (InterruptedException e) { logger.log(Level.SEVERE, "Unable to complete episode " + episode, e); } if (episodesPerSave > 0 && episode % episodesPerSave == 0) { saveState(new File(baseDirectory.getPath() + "/state" + episode + ".sepiaSave"), env.getModel().getState()); for (int j = 0; saveAgents && j < agents.length; j++) { try { ObjectOutputStream agentOut = new ObjectOutputStream( new FileOutputStream(baseDirectory.getPath() + "/agent" + j + "-" + episode)); agentOut.writeObject(agents[j]); agentOut.close(); } catch (Exception ex) { logger.info("Unable to save agent " + j); } } } } }