Java Code Examples for java.util.logging.Logger#finer()
The following examples show how to use
java.util.logging.Logger#finer() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestIsLoggable.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
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; } }
Example 2
Source File: TestIsLoggable.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
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; } }
Example 3
Source File: TestIsLoggable.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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; } }
Example 4
Source File: TestIsLoggable.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
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; } }
Example 5
Source File: TestIsLoggable.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
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; } }
Example 6
Source File: TestIsLoggable.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
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; } }
Example 7
Source File: LogLevelTest.java From appengine-tck with Apache License 2.0 | 6 votes |
@Test public void testLogLevelInAppLogLineMatchesActualLogLevelUsedWhenLogging() { Logger log = Logger.getLogger(LogLevelTest.class.getName()); log.finest("finest_testLogLevelMatches"); log.finer("finer_testLogLevelMatches"); log.fine("fine_testLogLevelMatches"); log.config("config_testLogLevelMatches"); log.info("info_testLogLevelMatches"); log.warning("warning_testLogLevelMatches"); log.severe("severe_testLogLevelMatches"); flush(log); assertLogContains("finest_testLogLevelMatches", LogService.LogLevel.DEBUG); assertLogContains("finer_testLogLevelMatches", LogService.LogLevel.DEBUG); assertLogContains("fine_testLogLevelMatches", LogService.LogLevel.DEBUG); assertLogContains("config_testLogLevelMatches", LogService.LogLevel.DEBUG); // we can't test the following on dev appserver, because it returns incorrect logLevels // more info at http://code.google.com/p/googleappengine/issues/detail?id=8651 //TODO:Renable after project compiles and runs. // assertLogContains("info_testLogLevelMatches", LogService.LogLevel.INFO); // assertLogContains("warning_testLogLevelMatches", LogService.LogLevel.WARN); // assertLogContains("severe_testLogLevelMatches", LogService.LogLevel.ERROR); }
Example 8
Source File: TestIsLoggable.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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; } }
Example 9
Source File: TestIsLoggable.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
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; } }
Example 10
Source File: TestIsLoggable.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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; } }
Example 11
Source File: EarlyHandlerTest.java From netbeans with Apache License 2.0 | 6 votes |
public void testEarlyPublish() throws Exception { EarlyHandler eh = Lookup.getDefault().lookup(EarlyHandler.class); Logger allLogger = Logger.getLogger("org.myapplication.ui.test_early"); // Copied Installer.UI_LOGGER_NAME, not to initialize Installer class. allLogger.setLevel(Level.ALL); allLogger.addHandler(eh); allLogger.fine("Test Message 1"); allLogger.info("Test Message 2"); allLogger.finest("Test Message 3"); Installer installer = Installer.findObject(Installer.class, true); installer.restored(); assertEquals("EarlyHandler turned off", Level.OFF, eh.getLevel()); allLogger.finer("Test Message 4"); List<LogRecord> logs = InstallerTest.getLogs(); assertEquals("Number of messages logged: ", 4, logs.size()); for (int i = 0; i < logs.size(); i++) { assertEquals("Test Message "+(i+1), logs.get(i).getMessage()); } }
Example 12
Source File: TestIsLoggable.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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; } }
Example 13
Source File: TestIsLoggable.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
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; } }
Example 14
Source File: Converter.java From lancoder with GNU General Public License v3.0 | 5 votes |
/** * Clean task's temporary folder. */ private void cleanTempFolder() { Logger logger = Logger.getLogger("lancoder"); File localFolder = filePathManager.getLocalTempFolder(task); logger.finer(String.format("Cleaning temp task folder '%s'.%n", localFolder)); if (localFolder.isDirectory()) { try { FileUtils.cleanDirectory(localFolder); } catch (IOException e) { e.printStackTrace(); } } }
Example 15
Source File: JMonkeyEngineTest.java From Bytecoder with Apache License 2.0 | 5 votes |
@Test public void testLogger() { final Logger logger = Logger.getLogger("Testlogger"); logger.setLevel(Level.INFO); logger.config("config"); logger.fine("fine"); logger.finer("finer"); logger.finest("finest"); logger.info("info"); logger.severe("severe"); logger.warning("warning"); }
Example 16
Source File: ResultImpl.java From baratine with GNU General Public License v2.0 | 5 votes |
private void logFail(Throwable exn) { Logger log = Logger.getLogger(Result.class.getName()); if (log.isLoggable(Level.FINER)) { log.finer(exn.toString()); } log.log(Level.FINEST, exn.toString(), exn); }
Example 17
Source File: Dependency.java From baratine with GNU General Public License v2.0 | 5 votes |
/** * Log the reason for a modification, returning true if this * dependency was modified. */ default boolean logModified(Logger log) { if (isModified()) { log.finer(this + " is modified"); return true; } else { return false; } }
Example 18
Source File: ShapefileByteReader.java From sis with Apache License 2.0 | 5 votes |
/** * Load polygon feature. * @param feature Feature to fill. */ private void loadPolygonFeature(AbstractFeature feature) { /* double xmin = */getByteBuffer().getDouble(); /* double ymin = */getByteBuffer().getDouble(); /* double xmax = */getByteBuffer().getDouble(); /* double ymax = */getByteBuffer().getDouble(); int numParts = getByteBuffer().getInt(); int numPoints = getByteBuffer().getInt(); Polygon poly; // Handle multiple polygon parts. if (numParts > 1) { Logger log = Logging.getLogger(ShapefileByteReader.class); if (log.isLoggable(Level.FINER)) { String format = "Polygon with multiple linear rings encountered at position {0,number} with {1,number} parts."; String message = MessageFormat.format(format, getByteBuffer().position(), numParts); log.finer(message); } poly = readMultiplePolygonParts(numParts, numPoints); } else { // Polygon with an unique part. poly = readUniquePolygonPart(numPoints); } feature.setPropertyValue(GEOMETRY_NAME, poly); }
Example 19
Source File: UserDataHelpers.java From roboconf-platform with Apache License 2.0 | 5 votes |
/** * Intercepts the properties and writes file contents. * @param props non-null properties * @param outputDirectory a directory into which files should be written * <p> * If null, files sent with {@link #ENCODE_FILE_CONTENT_PREFIX} will not be written. * </p> * * @throws IOException */ static void interceptWritingFiles( Properties props, File outputDirectory ) throws IOException { if( outputDirectory == null ) return; Logger logger = Logger.getLogger( UserDataHelpers.class.getName()); Set<String> keys = props.stringPropertyNames(); for( final String key : keys ) { if( ! key.startsWith( ENCODE_FILE_CONTENT_PREFIX )) continue; // Get the file content String encodedFileContent = props.getProperty( key ); String realKey = key.substring( ENCODE_FILE_CONTENT_PREFIX.length()); if( encodedFileContent == null ) { logger.fine( "No file content was provided for " + realKey + ". Skipping it..." ); continue; } byte[] fileContent = decodeFromBase64( encodedFileContent ); // Write it to the disk String targetFile = props.getProperty( realKey ); if( targetFile == null ) { logger.fine( "No property named " + realKey + " was found. Skipping it..." ); continue; } Utils.createDirectory( outputDirectory ); File output = new File( outputDirectory, new File( targetFile ).getName()); Utils.copyStream( new ByteArrayInputStream( fileContent ), output ); logger.finer( "Writing " + key + " from user data in " + output.getAbsolutePath()); // Update the properties props.remove( key ); props.setProperty( realKey, output.getAbsolutePath()); } }
Example 20
Source File: TestInferCaller.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
public void test4(Logger logger) { System.out.println("test4: " + loggerName(logger)); AtomicInteger count = new AtomicInteger(); assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: "); logger.setLevel(Level.ALL); assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: "); logger.severe(() -> "message " + count.incrementAndGet()); assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: "); LogEvent event = TestHandler.PUBLISHED.remove(); assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: "); checkEvent(event, this.getClass().getName(), "test4", "message " + count.get()); logger.warning(() -> "message " + count.incrementAndGet()); assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: "); event = TestHandler.PUBLISHED.remove(); assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: "); checkEvent(event, this.getClass().getName(), "test4", "message " + count.get()); logger.info(() -> "message " + count.incrementAndGet()); assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: "); event = TestHandler.PUBLISHED.remove(); assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: "); checkEvent(event, this.getClass().getName(), "test4", "message " + count.get()); logger.config(() -> "message " + count.incrementAndGet()); assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: "); event = TestHandler.PUBLISHED.remove(); assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: "); checkEvent(event, this.getClass().getName(), "test4", "message " + count.get()); logger.fine(() -> "message " + count.incrementAndGet()); assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: "); event = TestHandler.PUBLISHED.remove(); assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: "); checkEvent(event, this.getClass().getName(), "test4", "message " + count.get()); logger.finer(() -> "message " + count.incrementAndGet()); assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: "); event = TestHandler.PUBLISHED.remove(); assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: "); checkEvent(event, this.getClass().getName(), "test4", "message " + count.get()); logger.finest(() -> "message " + count.incrementAndGet()); assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: "); event = TestHandler.PUBLISHED.remove(); assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: "); checkEvent(event, this.getClass().getName(), "test4", "message " + count.get()); }