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.symbian.driver.remoting.master.QueuedExecutor.java
/** * Add the job to the executor's queue.//from w w w. j a v a 2s . co m * * @param aTestJob * TestJob object */ public void queueJob(TestJob aTestJob) { synchronized (testJobQueue) { aTestJob.setState(TestJob.WAITING); JobTracker.add(aTestJob.getId(), aTestJob.getState()); testJobQueue.add(aTestJob); takeSnapshot(); JobTracker.getInstance().takeSnapshot(); LOGGER.log(Level.FINE, "Master: Job " + aTestJob.getId() + " has been added to the Queue."); client.enableUpdate(aTestJob.getRegistrationId()); client.update( "Job " + aTestJob.getId() + " has been added to the Queue and is " + aTestJob.getState() + "."); client.disableUpdate(); testJobQueue.notify(); } }
From source file:com.elasticgrid.examples.video.MencoderEncoder.java
public File convertVideo(File original, String destName, String format, int width, int height, Integer start, Integer end, int vbr, int abr, int fps) throws VideoConversionException, InterruptedException { File videoConverted = new File(original.getParent(), destName); logger.log(Level.FINE, "Converting video {0} into {1} as {2} format...", new Object[] { original, videoConverted, format }); String command = String.format("%s %s -ofps %d -of lavf" + " -ovc lavc -lavcopts vcodec=%s:vbitrate=%d:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=%d:%d" + " -oac mp3lame -lameopts cbr:br=%d -srate 22050 -o %s", encoderLocation, original.getAbsolutePath(), fps, format, vbr, width, height, abr, videoConverted.getAbsolutePath()); if (start != null && end != null) command = String.format("%s -ss %d -endpos %d", command, start, end); logger.info("Command is: " + command); // run the external conversion program File log = new File(videoConverted.getParent(), videoConverted.getName().replace(format, "log")); logger.info("Writing output into " + log.getAbsolutePath()); FileWriter fileWriter = null; try {/*from w ww.ja va2s . c o m*/ fileWriter = enableLog ? new FileWriter(log) : null; logger.log(Level.FINEST, "Created log file in {0}", log); } catch (IOException e) { logger.log(Level.WARNING, "Can't open log file. Skipping...", e); fileWriter = null; } try { logger.finest(command); final Writer logWriter = enableLog ? new BufferedWriter(fileWriter) : null; final Process process = Runtime.getRuntime().exec(command); new Thread(new Runnable() { public void run() { try { BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; try { while ((line = reader.readLine()) != null) { if (enableLog) IOUtils.write(line, logWriter); } } finally { reader.close(); } } catch (IOException ioe) { ioe.printStackTrace(); } } }).start(); new Thread(new Runnable() { public void run() { try { BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream())); String line; try { while ((line = reader.readLine()) != null) { if (enableLog) IOUtils.write(line, logWriter); } } finally { reader.close(); } } catch (IOException ioe) { ioe.printStackTrace(); } } }).start(); process.waitFor(); return videoConverted; } catch (IOException e) { throw new VideoConversionException("Can't run video conversion software", e); } finally { if (enableLog) IOUtils.closeQuietly(fileWriter); } }
From source file:net.chrissearle.flickrvote.web.vote.ShowVoteChartAction.java
public String stats() throws Exception { initializeChallengeInfo();//from w ww . ja va 2s . c om ChallengeItem challenge = photographyService.getChallengeImages(challengeInfo.getChallengeTag()); images = new ArrayList<Image>(challenge.getImages().size()); for (ImageItem image : challenge.getImages()) { final DisplayImage displayImage = new DisplayImage(image); images.add(displayImage); if (logger.isLoggable(Level.FINE)) { logger.info("Saw " + displayImage.toString()); } } Collections.sort(images, new Comparator<Image>() { public int compare(Image o1, Image o2) { return o2.getVoteCount().compareTo(o1.getVoteCount()); } }); if (small) { height = (long) (18 * images.size()) + 20; } else { height = (long) (30 * images.size()) + 140; } return SUCCESS; }
From source file:com.stratuscom.harvester.ProfileConfigReader.java
@Init public void init() { try {//from ww w . j av a2 s . c o m ContainerConfig profileConfig = readProfileConfig(); /* We use Object not ClassLoader because it might have been loaded by a different classloader. */ log.log(Level.FINE, MessageNames.PROFILE_CONFIG_LOADING, new Object[] { containerClassLoader }); Bootstrap.processConfiguration(profileConfig, containerClassLoader, context); } catch (Exception ex) { throw new ConfigurationException(ex, MessageNames.PROFILE_CONFIG_EXCEPTION, profile); } }
From source file:io.fabric8.jenkins.openshiftsync.BuildTrigger.java
@Override public void run() { logger.log(Level.FINE, "Using Build watch as trigger, so not running trigger"); return; }
From source file:ca.sfu.federation.Application.java
/** * Start the application./*from w w w . jav a 2 s . co m*/ */ @Override public void run() { logger.log(Level.INFO, "Starting application"); // set the look and feel options try { logger.log(Level.FINE, "Setting look and feel options"); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); JPopupMenu.setDefaultLightWeightPopupEnabled(false); LookAndFeelUtil.removeAllSplitPaneBorders(); } catch (Exception e) { String stack = ExceptionUtils.getFullStackTrace(e); logger.log(Level.WARNING, "Could not set look and feel options\n\n{0}", stack); } // create the main application frame logger.log(Level.FINE, "Creating main application frame"); frame = new ApplicationFrame(); // show the application frame.setVisible(true); }
From source file:net.chrissearle.flickrvote.web.vote.VoteAction.java
@Override public String execute() throws Exception { if (logger.isLoggable(Level.FINE)) { logger.fine("execute"); }/*from w ww . ja v a 2s . c om*/ Photographer photographer = (Photographer) session.get(FlickrVoteWebConstants.FLICKR_USER_SESSION_KEY); if (logger.isLoggable(Level.INFO)) { logger.info("Votes by: " + photographer.getPhotographerName() + " [" + photographer.getPhotographerId() + "] : " + votes); } if (challengeService.hasVoted(photographer.getPhotographerId())) { if (logger.isLoggable(Level.INFO)) { logger.info("Photographer has already voted: " + photographer.getPhotographerName() + " [" + photographer.getPhotographerId() + "] : " + votes); } } else { for (String imageId : votes) { challengeService.vote(photographer.getPhotographerId(), imageId); } addActionMessage(getText("vote.thanks")); } return SUCCESS; }
From source file:cz.cas.lib.proarc.common.imports.InputUtils.java
private static boolean startWith(byte[] src, int srcLength, byte[] subarray) { if (subarray.length > srcLength) { return false; }//from www .j a va 2 s . c o m StringBuilder s1 = new StringBuilder(); StringBuilder s2 = new StringBuilder(); for (int i = 0; i < subarray.length; i++) { s1.append(src[i]); s2.append(subarray[i]); if (src[i] != subarray[i]) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "\nsrc: {0}\nsub: {1}", new Object[] { DatatypeConverter.printHexBinary(src), DatatypeConverter.printHexBinary(subarray) }); } return false; } } return true; }
From source file:edu.uci.ics.hyracks.algebricks.core.rewriter.base.AbstractRuleController.java
private String getPlanString(Mutable<ILogicalOperator> opRef) throws AlgebricksException { if (AlgebricksConfig.ALGEBRICKS_LOGGER.isLoggable(Level.FINE)) { StringBuilder sb = new StringBuilder(); LogicalOperatorPrettyPrintVisitor pvisitor = context.getPrettyPrintVisitor(); PlanPrettyPrinter.printOperator((AbstractLogicalOperator) opRef.getValue(), sb, pvisitor, 0); return sb.toString(); }/*from w w w .ja va 2 s. c o m*/ return null; }
From source file:alma.acs.logging.adapters.JacORBFilter.java
/** * Discards less useful or misleading Jacorb logs based on the message. * <p>//from w w w . j av a2 s . c om * TODO-: to improve performance, we could instead match file and line, but then would have to update * that information with the next jacorb code change. * The implementation already minimizes string comparison by checking only those messages that can occur at the given log level. * <p> * TODO: Add repeat guard based on the message, e.g. using MultipleRepeatGuard from jacsutil. */ public boolean isLoggable(LogRecord record) { String message = record.getMessage(); boolean isLoggable = true; if (record.getLevel().intValue() == Level.FINE.intValue()) { // map from FINE to FINEST if (message.startsWith("POA ") && (message.endsWith("shutdown is in progress") || message.endsWith("destruction is apparent") || message.endsWith("clear up the queue...") || message.endsWith("... done") || message.endsWith("stop the request controller") || message.endsWith("etherialize all servants ..."))) { record.setLevel(Level.FINEST); } else if (message.startsWith("get_policy_overrides returns") || message.startsWith("read GIOP message of size") || message.startsWith("wrote GIOP message of size")) { // From ACS unit tests it seems that this message is totally harmless, // caused by a Corba stub calling org.jacorb.orb.Delegate#getRelativeRoundtripTimeout() // and asking for the RELATIVE_RT_TIMEOUT_POLICY_TYPE policy. // We do not fully discard the log though because it may have other causes at the AOS. record.setLevel(Level.FINEST); // // Enable the following 2 lines to investigate for http://jira.alma.cl/browse/COMP-8302, to see where all these logs come from // String stackTrace = org.apache.commons.lang.exception.ExceptionUtils.getStackTrace(new Throwable()); // System.out.println("Hack for COMP-8302 debugging: 'get_policy_overrides returns' message logged with trace " + stackTrace); } // from FINE to discard else isLoggable = !(message.endsWith("_invoke: queuing request") || message.indexOf("is queued (queue size:") > 0 || message.endsWith("trying to get a RequestProcessor") || message.endsWith("waiting for queue") || message.endsWith("with request processing") || // for "starts...", "ends..." message.endsWith("invokeOperation on servant (stream based)") || message.endsWith("reset a previous completion call") || message.startsWith("Delegate.getReference") || message.startsWith("Received CodeSetContext. Using") || message.startsWith("ClientConnectionManager: releasing ClientGIOPConnection") || message.startsWith("Delegate released!") || message.endsWith(": streamClosed()") // findPOA: impl_name mismatch ); } else if (record.getLevel().intValue() == Level.INFO.intValue()) { // from INFO to CONFIG if (message.indexOf("(C) The JacORB project") > 0 || message.startsWith("Received CloseConnection on ClientGIOPConnection") || message.startsWith("prepare ORB for shutdown") || message.startsWith("Client-side TCP transport to") || message.startsWith("ORB going down...") || message.startsWith("ORB run") || // also "ORB run, exit" message.equals("ORB shutdown complete") || (message.startsWith("POA ") && (message.endsWith("destroyed"))) || message.startsWith("Opened new server-side TCP/IP")) { record.setLevel(Level.CONFIG); } // from INFO to FINEST else if (message.startsWith("Connected to ") || message.startsWith("Closed server-side transport to") || (message.startsWith("POA ") && (message.endsWith("up the queue ...") || message.endsWith("... done"))) || message.startsWith("Retrying to connect to") || message.startsWith("ClientConnectionManager: created new ClientGIOPConnection") || message.startsWith("ClientConnectionManager: found ClientGIOPConnection") || message.startsWith("Initialising ORB with ID") || message.startsWith("Set default native char codeset to") || message.startsWith("Set default native wchar codeset to") || message.equals("Listener exiting") || message.equals("ConsumerTie exited")) { record.setLevel(Level.FINEST); } // from INFO to stdout shortcut else if ((message.startsWith("ClientGIOPConnection to ") || message.startsWith("ServerGIOPConnection to ")) && message.contains(" BufferDump:\n") || message.startsWith("sendMessages(): ")) { // The jacorb dumps from org.jacorb.orb.etf.StreamConnectionBase.flush() // and org.jacorb.orb.giop.GIOPConnection.getMessage() are very special. // They get enabled via properties 'jacorb.debug.dump_outgoing_messages' // and 'jacorb.debug.dump_incoming_messages' and logged as INFO. // If they are enabled, we still want to see them only in the local logs // (otherwise there may be even "positive feedback" leading to log explosion). // A cleaner concept would be to only flag this LogRecord as "log only locally", // return "isLoggable = true" and leave the rest to the local and remote log handlers. // The fact that we are dealing with a generic LogRecord (not AcsLogRecord) makes this // option also ugly though (LogParameterUtil tricks), and thus we just print and drop // the log right away here. String timeStamp = IsoDateFormat.formatDate(new Date(record.getMillis())); System.out.println(timeStamp + " " + message); isLoggable = false; } // from INFO to discard else isLoggable = !(message.startsWith("oid: ") || message.startsWith("InterceptorManager started with") || message.startsWith("Using server ID (")); } else if (record.getLevel().intValue() == Level.WARNING.intValue()) { // from WARNING to CONFIG // if (message.indexOf("") > 0) { // record.setLevel(Level.CONFIG); // } // // from WARNING to FINEST // else if (message.startsWith("")) { // record.setLevel(Level.FINEST); // } // from WARNING to discard // else isLoggable = !(message.startsWith("no adapter activator exists for") // client tries to find remote poa locally and then complains if not there... ); } else if (record.getLevel().intValue() == Level.SEVERE.intValue()) { // HSO 07-02-19: thought this adapter activator crap was logged as warning, but now it showed up in jcont test as ACS-level "Emergency", which is JDK-SEVERE isLoggable = !(message.startsWith("no adapter activator exists for") // client tries to find remote poa locally and then complains if not there... ); } // filter by possibly modified log level if (isLoggable && record.getLevel().intValue() < this.logLevel) { isLoggable = false; } // if (!isLoggable) { // System.out.println("dropping JacORB message " + message + " with Level " + record.getLevel().getName()); // } // Remove non-ascii chars from the log message, which seems to occur only in logs coming from jacorb, // see http://jira.alma.cl/browse/COMP-3243 // For simplicity we blank all non-ascii-7-printable chars except newline and tab, // at the low risk of erroneously blanking more sophisticated (Umlaut etc) chars that jacorb may send us. // If that turns out to be the case, and the encoding turns out as unicode, then see http://en.wikipedia.org/wiki/C0_and_C1_control_codes if (isLoggable && message != null) { String message2 = null; int mlen = message.length(); for (int i = 0; i < mlen; i++) { char ch = message.charAt(i); if ((ch < 32 || ch >= 127) && ch != '\n' && ch != '\t') { // got a bad char if (message2 == null) { // copy the leading good chars only if needed, to improve performance message2 = message.substring(0, i); } // blank the bad char message2 += '#'; } else if (message2 != null) { message2 += ch; } } if (message2 != null) { record.setMessage(message2); } } return isLoggable; }