Java Code Examples for java.util.logging.Level.FINEST

The following are Jave code examples for showing how to use FINEST of the java.util.logging.Level class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: openjdk-jdk10   File: Log.java   View Source Code Vote up 6 votes
/**
 * 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 {@literal <} 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);
}
 
Example 2
Project: incubator-netbeans   File: FolderObj.java   View Source Code Vote up 6 votes
private void createFolder(final File folder2Create, final String name) throws IOException {
    boolean isSupported = new FileInfo(folder2Create).isSupportedFile();
    ProvidedExtensions extensions =  getProvidedExtensions();

    if (!isSupported) { 
        extensions.createFailure(this, folder2Create.getName(), true);
        FSException.io("EXC_CannotCreateFolder", folder2Create.getName(), getPath());// NOI18N   
    } else if (FileChangedManager.getInstance().exists(folder2Create)) {
        extensions.createFailure(this, folder2Create.getName(), true);            
        SyncFailedException sfe = new SyncFailedException(folder2Create.getAbsolutePath()); // NOI18N               
        String msg = NbBundle.getMessage(FileBasedFileSystem.class, "EXC_CannotCreateFolder", folder2Create.getName(), getPath()); // NOI18N
        Exceptions.attachLocalizedMessage(sfe, msg);
        throw sfe;
    } else if (!folder2Create.mkdirs()) {
        extensions.createFailure(this, folder2Create.getName(), true);
        FSException.io("EXC_CannotCreateFolder", folder2Create.getName(), getPath());// NOI18N               
    }
    LogRecord r = new LogRecord(Level.FINEST, "FolderCreated: "+ folder2Create.getAbsolutePath());
    r.setParameters(new Object[] {folder2Create});
    Logger.getLogger("org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj").log(r);
}
 
Example 3
Project: OpenJSharp   File: AbstractSaslImpl.java   View Source Code Vote up 5 votes
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);
    }
}
 
Example 4
Project: uavstack   File: PLogger.java   View Source Code Vote up 5 votes
private static Level getLevel(LogLevel level) {

        Level l = Level.INFO;
        switch (level) {
            case ALL:
                l = Level.ALL;
                break;
            case DEBUG:
                l = Level.FINEST;
                break;
            case ERR:
                l = Level.SEVERE;
                break;
            case FINE:
                l = Level.FINE;
                break;
            case FINER:
                l = Level.FINER;
                break;
            case INFO:
                l = Level.INFO;
                break;
            case WARNING:
                l = Level.WARNING;
                break;
            default:
                l = Level.INFO;
                break;
        }
        return l;
    }
 
Example 5
Project: WebSandboxMC   File: SettingsSponge.java   View Source Code Vote up 5 votes
@Override
public void log(Level level, String message) {
    if (level == Level.FINEST && !debug) {
        return;
    }

    if (level == Level.FINEST) {
        plugin.logger.debug(message);
    } else if (level == Level.WARNING) {
        plugin.logger.warn(message);
    } else {
        plugin.logger.info(message);
    }
}
 
Example 6
Project: openjdk-jdk10   File: AbstractSaslImpl.java   View Source Code Vote up 5 votes
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, origlen, content});
    } catch (Exception e) {
        logger.logp(Level.WARNING, srcClass, srcMethod,
            "SASLIMPL09:Error generating trace output: {0}", e);
    }
}
 
Example 7
Project: incubator-netbeans   File: FolderObjTest.java   View Source Code Vote up 5 votes
@Override
protected Level logLevel() {
    String[] testsWithEnabledLogger = new String[] {
        "testCreateFolder72617",
        "testCreateData72617",
        ".testBug127256"
    };
    return (Arrays.asList(testsWithEnabledLogger).contains(getName())) ? 
        Level.FINEST : Level.OFF;
}
 
Example 8
Project: hazelcast-docker-swarm-discovery-spi   File: SystemPrintLogger.java   View Source Code Vote up 4 votes
@Override
public Level getLevel() {
	return Level.FINEST;
}
 
Example 9
Project: incubator-netbeans   File: CLIHandlerServerWaitsTest.java   View Source Code Vote up 4 votes
protected @Override Level logLevel() {
    return Level.FINEST;
}
 
Example 10
Project: incubator-netbeans   File: CLIHandlerTest.java   View Source Code Vote up 4 votes
protected @Override Level logLevel() {
    return Level.FINEST;
}
 
Example 11
Project: incubator-netbeans   File: RecognizeInstanceFilesTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINEST;
}
 
Example 12
Project: incubator-netbeans   File: CLIHandlerGrepTest.java   View Source Code Vote up 4 votes
protected @Override Level logLevel() {
    return Level.FINEST;
}
 
Example 13
Project: jdk8u-jdk   File: TestLoggerBundleSync.java   View Source Code Vote up 4 votes
@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);
   }
}
 
Example 14
Project: incubator-netbeans   File: SharedClassObjectFactoryTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINEST;
}
 
Example 15
Project: incubator-netbeans   File: FileUtilAddRecursiveListenerFilterTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINEST;
}
 
Example 16
Project: PlusGram   File: MP3Info.java   View Source Code Vote up 4 votes
public MP3Info(InputStream input, long fileLength) throws IOException, ID3v2Exception, MP3Exception {
	this(input, fileLength, Level.FINEST);
}
 
Example 17
Project: PlusGram   File: M4AInfo.java   View Source Code Vote up 4 votes
public M4AInfo(InputStream input) throws IOException {
	this(input, Level.FINEST);
}
 
Example 18
Project: incubator-netbeans   File: StartLog.java   View Source Code Vote up 4 votes
@Override
public Level getLevel() {
    return willLog() ? Level.FINEST : Level.OFF;
}
 
Example 19
Project: airgram   File: M4AInfo.java   View Source Code Vote up 4 votes
public M4AInfo(InputStream input) throws IOException {
	this(input, Level.FINEST);
}
 
Example 20
Project: incubator-netbeans   File: FileUtilAddRecursiveListenerStopTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINEST;
}