java.util.logging.Logger#fine ( )源码实例Demo

下面列出了java.util.logging.Logger#fine ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
public void run() {
    try {
        while (goOn) {
            Logger l;
            Logger foo = Logger.getLogger("foo");
            Logger bar = Logger.getLogger("foo.bar");
            for (int i=0; i < LCOUNT ; i++) {
                l = Logger.getLogger("foo.bar.l"+nextLogger.incrementAndGet());
                l.fine("I'm fine");
                if (!goOn) break;
                Thread.sleep(1);
            }
        }
    } catch (InterruptedException | RuntimeException x ) {
        fail(x);
    }
}
 
源代码2 项目: roboconf-platform   文件: DockerUtils.java
/**
 * Finds an image by ID or by tag.
 * @param name an image ID or a tag name (can be null)
 * @param dockerClient a Docker client (not null)
 * @return an image, or null if none matched
 */
public static Image findImageByIdOrByTag( String name, DockerClient dockerClient ) {

	Image image = null;
	if( ! Utils.isEmptyOrWhitespaces( name )) {
		Logger logger = Logger.getLogger( DockerUtils.class.getName());

		List<Image> images = dockerClient.listImagesCmd().exec();
		if(( image = DockerUtils.findImageById( name, images )) != null )
			logger.fine( "Found a Docker image with ID " + name );
		else if(( image = DockerUtils.findImageByTag( name, images )) != null )
			logger.fine( "Found a Docker image with tag " + name );
	}

	return image;
}
 
源代码3 项目: hottub   文件: TestIsLoggable.java
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;
    }
}
 
@Override
public void run() {
    try {
        while (goOn) {
            Logger l;
            int barcount = getBarCount();
            for (int i=0; i < LCOUNT ; i++) {
                l = Logger.getLogger("foo.bar"+barcount+".l"+nextLogger.incrementAndGet());
                l.fine("I'm fine");
                if (!goOn) break;
                Thread.sleep(1);
            }
        }
    } catch (InterruptedException | RuntimeException x ) {
        fail(x);
    }
}
 
源代码5 项目: syslog-java-client   文件: SyslogHandlerTest.java
@Test
public void test(){
    Logger logger = Logger.getLogger(getClass().getName());
    logger.setLevel(Level.FINEST);

    UdpSyslogMessageSender messageSender = new UdpSyslogMessageSender();
    SyslogHandler syslogHandler = new SyslogHandler(messageSender, Level.ALL, null);

    messageSender.setSyslogServerHostname("cloudbees1.papertrailapp.com");
    messageSender.setSyslogServerPort(18977);

    syslogHandler.setMessageHostname("mysecretkey");
    syslogHandler.setAppName("SyslogHandlerTest");
    logger.addHandler(syslogHandler);

    logger.fine("hello world 2");
}
 
@Override
public void run() {
    try {
        while (goOn) {
            Logger l;
            int barcount = getBarCount();
            for (int i=0; i < LCOUNT ; i++) {
                l = Logger.getLogger("foo.bar"+barcount+".l"+nextLogger.incrementAndGet());
                l.fine("I'm fine");
                if (!goOn) break;
                Thread.sleep(1);
            }
        }
    } catch (InterruptedException | RuntimeException x ) {
        fail(x);
    }
}
 
@Override
public void run() {
    try {
        while (goOn) {
            Logger l;
            int barcount = getBarCount();
            for (int i=0; i < LCOUNT ; i++) {
                l = Logger.getLogger("foo.bar"+barcount+".l"+nextLogger.incrementAndGet());
                l.fine("I'm fine");
                if (!goOn) break;
                Thread.sleep(1);
            }
        }
    } catch (InterruptedException | RuntimeException x ) {
        fail(x);
    }
}
 
源代码8 项目: openjdk-8   文件: TestIsLoggable.java
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;
    }
}
 
@Override
public void run() {
    try {
        while (goOn) {
            Logger l;
            int barcount = getBarCount();
            for (int i=0; i < LCOUNT ; i++) {
                l = Logger.getLogger("foo.bar"+barcount+".l"+nextLogger.incrementAndGet());
                l.fine("I'm fine");
                if (!goOn) break;
                Thread.sleep(1);
            }
        }
    } catch (InterruptedException | RuntimeException x ) {
        fail(x);
    }
}
 
源代码10 项目: roboconf-platform   文件: ProgramUtils.java
/**
 * Executes a command on the VM and logs the output.
 * @param logger a logger (not null)
 * @param command a command to execute (not null, not empty)
 * @param workingDir the working directory for the command
 * @param environmentVars a map containing environment variables (can be null)
 * @param applicationName the roboconf application name (null if not specified)
 * @param scopedInstancePath the roboconf scoped instance path (null if not specified)
 * @throws IOException if a new process could not be created
 * @throws InterruptedException if the new process encountered a process
 */
public static int executeCommand(
		final Logger logger,
		final String[] command,
		final File workingDir,
		final Map<String,String> environmentVars,
		final String applicationName,
		final String scopedInstancePath)
throws IOException, InterruptedException {

	ExecutionResult result = executeCommandWithResult( logger, command, workingDir, environmentVars, applicationName, scopedInstancePath);
	if( ! Utils.isEmptyOrWhitespaces( result.getNormalOutput()))
		logger.fine( result.getNormalOutput());

	if( ! Utils.isEmptyOrWhitespaces( result.getErrorOutput()))
		logger.warning( result.getErrorOutput());

	return result.getExitValue();
}
 
源代码11 项目: netbeans   文件: EarlyHandlerTest.java
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());
    }
}
 
@Override
public void run() {
    try {
        while (goOn) {
            Logger l;
            int barcount = getBarCount();
            for (int i=0; i < LCOUNT ; i++) {
                l = Logger.getLogger("foo.bar"+barcount+".l"+nextLogger.incrementAndGet());
                l.fine("I'm fine");
                if (!goOn) break;
                Thread.sleep(1);
            }
        }
    } catch (InterruptedException | RuntimeException x ) {
        fail(x);
    }
}
 
源代码13 项目: LPAd_SM-DPPlus_Connector   文件: LogStub.java
public void logDebug(Logger logger, String message) {

        if (isAndroidLog()) {
            logger.info(message);
        } else {
            logger.fine(message);
        }
    }
 
源代码14 项目: lancoder   文件: Worker.java
@Override
public synchronized void taskCancelled(ClientTask task) {
	Logger logger = Logger.getLogger("lancoder");
	logger.fine(String.format("Cancelled %s.%n", task));

	task.getProgress().reset();
	notifyAndRemove(task);
}
 
源代码15 项目: netbeans   文件: LogAndTimeOutTest.java
public void testLoadFromSubdirTheSFS() throws Exception {
    Logger log = Logger.getLogger(T.class.getName());
    for (int i = 0; i < 100; i++) {
        log.fine("Adding " + i);
        Thread.sleep(100);
    }
}
 
源代码16 项目: gemfirexd-oss   文件: NativeCallsJNAImpl.java
@Override
public void preBlow(String path, long maxSize, boolean preAllocate)
    throws IOException {
  final Logger logger = ClientSharedUtils.getLogger();
  if (logger != null && logger.isLoggable(Level.FINE)) {
    logger.fine("DEBUG preBlow called for path = " + path);
  }
  if (!preAllocate || !hasFallocate()) {
    super.preBlow(path, maxSize, preAllocate);
    if (logger != null && logger.isLoggable(Level.FINE)) {
      logger.fine("DEBUG preBlow super.preBlow 1 called for path = "
          + path);
    }
    return;
  }
  int fd = -1;
  boolean unknownError = false;
  try {
    fd = createFD(path, 00644);
    if (!isOnLocalFileSystem(path)) {
      super.preBlow(path, maxSize, preAllocate);
      if (logger != null && logger.isLoggable(Level.FINE)) {
        logger.fine("DEBUG preBlow super.preBlow 2 called as path = "
            + path + " not on local file system");
      }
      if (TEST_NO_FALLOC_DIRS != null) {
        TEST_NO_FALLOC_DIRS.add(path);
      }
      return;
    }
    fallocateFD(fd, 0L, maxSize);
    if (TEST_CHK_FALLOC_DIRS != null) {
      TEST_CHK_FALLOC_DIRS.add(path);
    }
    if (logger != null && logger.isLoggable(Level.FINE)) {
      logger.fine("DEBUG preBlow posix_fallocate called for path = " + path
          + " and ret = 0 maxsize = " + maxSize);
    }
  } catch (LastErrorException le) {
    if (logger != null && logger.isLoggable(Level.FINE)) {
      logger.fine("DEBUG preBlow posix_fallocate called for path = " + path
          + " and ret = " + le.getErrorCode() + " maxsize = " + maxSize);
    }
    // check for no space left on device
    if (le.getErrorCode() == ENOSPC) {
      unknownError = false;
      throw new IOException("Not enough space left on device");
    }
    else {
      unknownError = true;
    }
  } finally {
    if (fd >= 0) {
      try {
        close(fd);
      } catch (Exception e) {
        // ignore
      }
    }
    if (unknownError) {
      super.preBlow(path, maxSize, preAllocate);
      if (logger != null && logger.isLoggable(Level.FINE)) {
        logger.fine("DEBUG preBlow super.preBlow 3 called for path = "
            + path);
      }
    }
  }
}
 
源代码17 项目: openjdk-jdk9   文件: ClassLoaderLeakTest.java
public void launch(CountDownLatch done) {
    Logger log = Logger.getLogger("app_test_logger");
    log.fine("Test app is launched");

    done.countDown();
}
 
源代码18 项目: TencentKona-8   文件: ClassLoaderLeakTest.java
public void launch(CountDownLatch done) {
    Logger log = Logger.getLogger("app_test_logger");
    log.fine("Test app is launched");

    done.countDown();
}
 
源代码19 项目: openjdk-8-source   文件: ClassLoaderLeakTest.java
public void launch(CountDownLatch done) {
    Logger log = Logger.getLogger("app_test_logger");
    log.fine("Test app is launched");

    done.countDown();
}
 
源代码20 项目: openjdk-8   文件: ClassLoaderLeakTest.java
public void launch(CountDownLatch done) {
    Logger log = Logger.getLogger("app_test_logger");
    log.fine("Test app is launched");

    done.countDown();
}