FINEST源码实例Demo

java.util.logging.Level#FINEST源码实例Demo

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

源代码1 项目: fabric-chaincode-java   文件: ChaincodeBase.java
private Level mapLevel(final String level) {

        if (level != null) {
            switch (level.toUpperCase().trim()) {
            case "CRITICAL":
            case "ERROR":
                return Level.SEVERE;
            case "WARNING":
                return Level.WARNING;
            case "INFO":
                return Level.INFO;
            case "NOTICE":
                return Level.CONFIG;
            case "DEBUG":
                return Level.FINEST;
            default:
                break;
            }
        }
        return Level.INFO;
    }
 
private void createIcon() {
  Level[] levels = {Level.FINEST,//
    Level.FINER,//
    Level.FINE,//
    Level.CONFIG,//
    Level.INFO,//
    Level.WARNING,//
    Level.SEVERE,//
  };
  ArrayList<Icon> iconsList = new ArrayList<>();
  for (Level l : levels) {
    if (l.intValue() < levelIntValue) {
      final Icon iconByLevel = LevelRenderer.getIconByLevel(l);
      iconsList.add(iconByLevel);
    }
  }
  icon = new CompoundIcon(iconsList);
}
 
源代码3 项目: openjdk-jdk8u   文件: Log.java
/**
 * Access log for a tri-state system property.
 *
 * Need to first convert override value to a log level, taking
 * care to interpret a range of values between BRIEF, VERBOSE and
 * SILENT.
 *
 * An override < 0 is interpreted to mean that the logging
 * configuration should not be overridden. The level passed to the
 * factories createLog method will be null in this case.
 *
 * Note that if oldLogName is null and old logging is on, the
 * returned LogStreamLog will ignore the override parameter - the
 * log will never log messages.  This permits new logs that only
 * write to Loggers to do nothing when old logging is active.
 *
 * Do not call getLog multiple times on the same logger name.
 * Since this is an internal API, no checks are made to ensure
 * that multiple logs do not exist for the same logger.
 */
public static Log getLog(String loggerName, String oldLogName,
                         int override)
{
    Level level;

    if (override < 0) {
        level = null;
    } else if (override == LogStream.SILENT) {
        level = Level.OFF;
    } else if ((override > LogStream.SILENT) &&
               (override <= LogStream.BRIEF)) {
        level = BRIEF;
    } else if ((override > LogStream.BRIEF) &&
               (override <= LogStream.VERBOSE))
    {
        level = VERBOSE;
    } else {
        level = Level.FINEST;
    }
    return logFactory.createLog(loggerName, oldLogName, level);
}
 
源代码4 项目: tracecompass   文件: TransientState.java
/**
 * Generalized 2D iterable query method. Iterates over intervals that match
 * the conditions on quarks and times in the Transient State.
 *
 * @param quarks
 *            Collection of quarks for returned intervals.
 * @param timeCondition
 *            Condition on the times for returned intervals
 * @return An iterable over the queried intervals, ordered by quarks.
 * @since 2.1
 */
public Iterable<ITmfStateInterval> query2D(Collection<Integer> quarks, TimeRangeCondition timeCondition) {
    fRWLock.readLock().lock();
    try (TraceCompassLogUtils.ScopeLog log = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.FINEST, "TransientState:query2D", //$NON-NLS-1$
            "ssid", fBackend.getSSID(), //$NON-NLS-1$
            "quarks", quarks, //$NON-NLS-1$
            "time", timeCondition)) { //$NON-NLS-1$
        if (!fIsActive) {
            return Collections.emptyList();
        }
        long end = timeCondition.max();
        Collection<ITmfStateInterval> iterable = new ArrayList<>();
        for (Integer quark : quarks) {
            ITmfStateInterval interval = getIntervalAt(end, quark);
            if (interval != null) {
                iterable.add(interval);
            }
        }
        return iterable;
    } finally {
        fRWLock.readLock().unlock();
    }
}
 
源代码5 项目: reef   文件: CLRBufferedLogHandler.java
/**
 * Flushes the log buffer, logging each buffered log message using
 * the reef-bridge log function.
 */
private void logAll() {
  synchronized (this) {
    final StringBuilder sb = new StringBuilder();
    Level highestLevel = Level.FINEST;
    for (final LogRecord record : this.logs) {
      sb.append(formatter.format(record));
      sb.append("\n");
      if (record.getLevel().intValue() > highestLevel.intValue()) {
        highestLevel = record.getLevel();
      }
    }
    try {
      final int level = getLevel(highestLevel);
      NativeInterop.clrBufferedLog(level, sb.toString());
    } catch (Exception e) {
      System.err.println("Failed to perform CLRBufferedLogHandler");
    }

    this.logs.clear();
  }
}
 
源代码6 项目: sequence-mining   文件: SequenceMining.java
@Override
public Level convert(final String value) {
	if (value.equals("SEVERE"))
		return Level.SEVERE;
	else if (value.equals("WARNING"))
		return Level.WARNING;
	else if (value.equals("INFO"))
		return Level.INFO;
	else if (value.equals("CONFIG"))
		return Level.CONFIG;
	else if (value.equals("FINE"))
		return Level.FINE;
	else if (value.equals("FINER"))
		return Level.FINER;
	else if (value.equals("FINEST"))
		return Level.FINEST;
	else
		throw new RuntimeException("Incorrect Log Level.");
}
 
源代码7 项目: fabric-chaincode-java   文件: Logging.java
private static Level mapLevel(final String level) {
    if (level != null) {
        switch (level.toUpperCase().trim()) {
        case "ERROR":
        case "CRITICAL":
            return Level.SEVERE;
        case "WARNING":
            return Level.WARNING;
        case "INFO":
            return Level.INFO;
        case "NOTICE":
            return Level.CONFIG;
        case "DEBUG":
            return Level.FINEST;
        default:
            return Level.INFO;
        }
    }
    return Level.INFO;
}
 
源代码8 项目: openjdk-8   文件: AbstractSaslImpl.java
protected static final void traceOutput(String srcClass, String srcMethod,
    String traceTag, byte[] output, int offset, int len) {
    try {
        int origlen = len;
        Level lev;

        if (!logger.isLoggable(Level.FINEST)) {
            len = Math.min(16, len);
            lev = Level.FINER;
        } else {
            lev = Level.FINEST;
        }

        String content;

        if (output != null) {
            ByteArrayOutputStream out = new ByteArrayOutputStream(len);
            new HexDumpEncoder().encodeBuffer(
                new ByteArrayInputStream(output, offset, len), out);
            content = out.toString();
        } else {
            content = "NULL";
        }

        // Message id supplied by caller as part of traceTag
        logger.logp(lev, srcClass, srcMethod, "{0} ( {1} ): {2}",
            new Object[] {traceTag, new Integer(origlen), content});
    } catch (Exception e) {
        logger.logp(Level.WARNING, srcClass, srcMethod,
            "SASLIMPL09:Error generating trace output: {0}", e);
    }
}
 
源代码9 项目: gdx-gamesvcs   文件: GpgsClient.java
/**
 * Gdx to Log4j log level mapping
 */
private static Level getLogLevel(int logLevel) {
    switch (logLevel) {
        case Application.LOG_NONE:
            return Level.OFF;
        case Application.LOG_ERROR:
            return Level.SEVERE;
        case Application.LOG_INFO:
            return Level.INFO;
        case Application.LOG_DEBUG:
            return Level.FINEST;
        default:
            return Level.ALL;
    }
}
 
源代码10 项目: roboconf-platform   文件: RoboconfLogFormatter.java
/**
 * @return the maximum length of a log level
 */
static int findMaxLevelLength() {

	Level[] levels = new Level[] {
			Level.ALL, Level.CONFIG, Level.FINE,
			Level.FINER, Level.FINEST, Level.INFO,
			Level.OFF, Level.SEVERE, Level.WARNING
	};

	int result = -1;
	for( Level level : levels )
		result = Math.max( result, level.toString().length());

	return result;
}
 
源代码11 项目: TencentKona-8   文件: AbstractSaslImpl.java
protected static final void traceOutput(String srcClass, String srcMethod,
    String traceTag, byte[] output, int offset, int len) {
    try {
        int origlen = len;
        Level lev;

        if (!logger.isLoggable(Level.FINEST)) {
            len = Math.min(16, len);
            lev = Level.FINER;
        } else {
            lev = Level.FINEST;
        }

        String content;

        if (output != null) {
            ByteArrayOutputStream out = new ByteArrayOutputStream(len);
            new HexDumpEncoder().encodeBuffer(
                new ByteArrayInputStream(output, offset, len), out);
            content = out.toString();
        } else {
            content = "NULL";
        }

        // Message id supplied by caller as part of traceTag
        logger.logp(lev, srcClass, srcMethod, "{0} ( {1} ): {2}",
            new Object[] {traceTag, new Integer(origlen), content});
    } catch (Exception e) {
        logger.logp(Level.WARNING, srcClass, srcMethod,
            "SASLIMPL09:Error generating trace output: {0}", e);
    }
}
 
源代码12 项目: dragonwell8_jdk   文件: TestLoggerBundleSync.java
@Override
public void run() {
    try {
        handler.setLevel(Level.FINEST);
        while (goOn) {
            Logger l;
            Logger foo = Logger.getLogger("foo");
            Logger bar = Logger.getLogger("foo.bar");
            for (long i=0; i < nextLong.longValue() + 100 ; i++) {
                if (!goOn) break;
                l = Logger.getLogger("foo.bar.l"+i);
                final ResourceBundle b = l.getResourceBundle();
                final String name = l.getResourceBundleName();
                if (b != null) {
                    if (!name.equals(b.getBaseBundleName())) {
                        throw new RuntimeException("Unexpected bundle name: "
                                +b.getBaseBundleName());
                    }
                }
                Logger ll = Logger.getLogger(l.getName()+".bie.bye");
                ResourceBundle hrb;
                String hrbName;
                if (handler.getLevel() != Level.FINEST) {
                    throw new RuntimeException("Handler level is not finest: "
                            + handler.getLevel());
                }
                final int countBefore = handler.count;
                handler.reset();
                ll.setLevel(Level.FINEST);
                ll.addHandler(handler);
                ll.log(Level.FINE, "dummy {0}", this);
                ll.removeHandler(handler);
                final int countAfter = handler.count;
                if (countBefore == countAfter) {
                    throw new RuntimeException("Handler not called for "
                            + ll.getName() + "("+ countAfter +")");
                }
                hrb = handler.rb;
                hrbName = handler.rbName;
                if (name != null) {
                    // if name is not null, then it implies that it
                    // won't change, since setResourceBundle() cannot
                    // replace a non null name.
                    // Since we never set the resource bundle on 'll',
                    // then ll must inherit its resource bundle [name]
                    // from l - and therefor we should find it in
                    // handler.rb/handler.rbName
                    if (!name.equals(hrbName)) {
                        throw new RuntimeException("Unexpected bundle name: "
                                +hrbName);
                    }
                    // here we know that hrbName is not null so hrb
                    // should not be null either.
                    if (!name.equals(hrb.getBaseBundleName())) {
                        throw new RuntimeException("Unexpected bundle name: "
                                +hrb.getBaseBundleName());
                    }
                }

                // Make sure to refer to 'l' explicitly in order to
                // prevent eager garbage collecting before the end of
                // the test (JDK-8030192)
                if (!ll.getName().startsWith(l.getName())) {
                    throw new RuntimeException("Logger " + ll.getName()
                            + "does not start with expected prefix "
                            + l.getName());
                }

                getRBcount.incrementAndGet();
                if (!goOn) break;
                Thread.sleep(1);
            }
        }
   } catch (Exception x) {
       fail(x);
   }
}
 
源代码13 项目: jdk8u-jdk   文件: TestLoggerBundleSync.java
@Override
public void run() {
    try {
        handler.setLevel(Level.FINEST);
        while (goOn) {
            Logger l;
            Logger foo = Logger.getLogger("foo");
            Logger bar = Logger.getLogger("foo.bar");
            for (long i=0; i < nextLong.longValue() + 100 ; i++) {
                if (!goOn) break;
                l = Logger.getLogger("foo.bar.l"+i);
                final ResourceBundle b = l.getResourceBundle();
                final String name = l.getResourceBundleName();
                if (b != null) {
                    if (!name.equals(b.getBaseBundleName())) {
                        throw new RuntimeException("Unexpected bundle name: "
                                +b.getBaseBundleName());
                    }
                }
                Logger ll = Logger.getLogger(l.getName()+".bie.bye");
                ResourceBundle hrb;
                String hrbName;
                if (handler.getLevel() != Level.FINEST) {
                    throw new RuntimeException("Handler level is not finest: "
                            + handler.getLevel());
                }
                final int countBefore = handler.count;
                handler.reset();
                ll.setLevel(Level.FINEST);
                ll.addHandler(handler);
                ll.log(Level.FINE, "dummy {0}", this);
                ll.removeHandler(handler);
                final int countAfter = handler.count;
                if (countBefore == countAfter) {
                    throw new RuntimeException("Handler not called for "
                            + ll.getName() + "("+ countAfter +")");
                }
                hrb = handler.rb;
                hrbName = handler.rbName;
                if (name != null) {
                    // if name is not null, then it implies that it
                    // won't change, since setResourceBundle() cannot
                    // replace a non null name.
                    // Since we never set the resource bundle on 'll',
                    // then ll must inherit its resource bundle [name]
                    // from l - and therefor we should find it in
                    // handler.rb/handler.rbName
                    if (!name.equals(hrbName)) {
                        throw new RuntimeException("Unexpected bundle name: "
                                +hrbName);
                    }
                    // here we know that hrbName is not null so hrb
                    // should not be null either.
                    if (!name.equals(hrb.getBaseBundleName())) {
                        throw new RuntimeException("Unexpected bundle name: "
                                +hrb.getBaseBundleName());
                    }
                }

                // Make sure to refer to 'l' explicitly in order to
                // prevent eager garbage collecting before the end of
                // the test (JDK-8030192)
                if (!ll.getName().startsWith(l.getName())) {
                    throw new RuntimeException("Logger " + ll.getName()
                            + "does not start with expected prefix "
                            + l.getName());
                }

                getRBcount.incrementAndGet();
                if (!goOn) break;
                Thread.sleep(1);
            }
        }
   } catch (Exception x) {
       fail(x);
   }
}
 
源代码14 项目: openjdk-jdk8u-backup   文件: TestAnonymousLogger.java
public static void main(String[] args) {
    System.setSecurityManager(new SecurityManager());
    Logger anonymous = Logger.getAnonymousLogger();

    final TestHandler handler = new TestHandler();
    final TestFilter filter = new TestFilter();
    final ResourceBundle bundle = ResourceBundle.getBundle(TestBundle.class.getName());
    anonymous.setLevel(Level.FINEST);
    anonymous.addHandler(handler);
    anonymous.setFilter(filter);
    anonymous.setUseParentHandlers(true);
    anonymous.setResourceBundle(bundle);

    if (anonymous.getLevel() != Level.FINEST) {
        throw new RuntimeException("Unexpected level: " + anonymous.getLevel());
    } else {
        System.out.println("Got expected level: " + anonymous.getLevel());
    }
    if (!Arrays.asList(anonymous.getHandlers()).contains(handler)) {
        throw new RuntimeException("Expected handler not found in: "
                + Arrays.asList(anonymous.getHandlers()));
    } else {
        System.out.println("Got expected handler in: " + Arrays.asList(anonymous.getHandlers()));
    }
    if (anonymous.getFilter() != filter) {
        throw new RuntimeException("Unexpected filter: " + anonymous.getFilter());
    } else {
        System.out.println("Got expected filter: " + anonymous.getFilter());
    }
    if (!anonymous.getUseParentHandlers()) {
        throw new RuntimeException("Unexpected flag: " + anonymous.getUseParentHandlers());
    } else {
        System.out.println("Got expected flag: " + anonymous.getUseParentHandlers());
    }
    if (anonymous.getResourceBundle() != bundle) {
        throw new RuntimeException("Unexpected bundle: " + anonymous.getResourceBundle());
    } else {
        System.out.println("Got expected bundle: " + anonymous.getResourceBundle());
    }
    try {
        anonymous.setParent(Logger.getLogger("foo.bar"));
        throw new RuntimeException("Expected SecurityException not raised!");
    } catch (SecurityException x) {
        System.out.println("Got expected exception: " + x);
    }
    if (anonymous.getParent() != Logger.getLogger("")) {
        throw new RuntimeException("Unexpected parent: " + anonymous.getParent());
    } else {
        System.out.println("Got expected parent: " + anonymous.getParent());
    }
}
 
源代码15 项目: netbeans   文件: FolderObjCacheTest.java
@Override
protected Level logLevel() {
    return Level.FINEST;
}
 
源代码16 项目: netbeans   文件: CLIHandlerGrepTest.java
protected @Override Level logLevel() {
    return Level.FINEST;
}
 
源代码17 项目: openjdk-8   文件: TestAnonymousLogger.java
public static void main(String[] args) {
    System.setSecurityManager(new SecurityManager());
    Logger anonymous = Logger.getAnonymousLogger();

    final TestHandler handler = new TestHandler();
    final TestFilter filter = new TestFilter();
    final ResourceBundle bundle = ResourceBundle.getBundle(TestBundle.class.getName());
    anonymous.setLevel(Level.FINEST);
    anonymous.addHandler(handler);
    anonymous.setFilter(filter);
    anonymous.setUseParentHandlers(true);
    anonymous.setResourceBundle(bundle);

    if (anonymous.getLevel() != Level.FINEST) {
        throw new RuntimeException("Unexpected level: " + anonymous.getLevel());
    } else {
        System.out.println("Got expected level: " + anonymous.getLevel());
    }
    if (!Arrays.asList(anonymous.getHandlers()).contains(handler)) {
        throw new RuntimeException("Expected handler not found in: "
                + Arrays.asList(anonymous.getHandlers()));
    } else {
        System.out.println("Got expected handler in: " + Arrays.asList(anonymous.getHandlers()));
    }
    if (anonymous.getFilter() != filter) {
        throw new RuntimeException("Unexpected filter: " + anonymous.getFilter());
    } else {
        System.out.println("Got expected filter: " + anonymous.getFilter());
    }
    if (!anonymous.getUseParentHandlers()) {
        throw new RuntimeException("Unexpected flag: " + anonymous.getUseParentHandlers());
    } else {
        System.out.println("Got expected flag: " + anonymous.getUseParentHandlers());
    }
    if (anonymous.getResourceBundle() != bundle) {
        throw new RuntimeException("Unexpected bundle: " + anonymous.getResourceBundle());
    } else {
        System.out.println("Got expected bundle: " + anonymous.getResourceBundle());
    }
    try {
        anonymous.setParent(Logger.getLogger("foo.bar"));
        throw new RuntimeException("Expected SecurityException not raised!");
    } catch (SecurityException x) {
        System.out.println("Got expected exception: " + x);
    }
    if (anonymous.getParent() != Logger.getLogger("")) {
        throw new RuntimeException("Unexpected parent: " + anonymous.getParent());
    } else {
        System.out.println("Got expected parent: " + anonymous.getParent());
    }
}
 
@Override
public Level getLevel() {
    return Level.FINEST;
}
 
源代码19 项目: TelePlus-Android   文件: M4AInfo.java
public M4AInfo(InputStream input) throws IOException {
	this(input, Level.FINEST);
}
 
源代码20 项目: cougar   文件: TraceLogRecord.java
public TraceLogRecord(String uUID, String msg, Throwable exception) {
	super(null, Level.FINEST, exceptionMessageConstructor(uUID, msg, exception));
	setThrown(exception);
	this.uUID = uUID;
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 方法所在类