Java Code Examples for sun.util.logging.PlatformLogger#isLoggable()

The following examples show how to use sun.util.logging.PlatformLogger#isLoggable() . 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: HttpsClient.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 *  Same as previous constructor except using a Proxy
 */
HttpsClient(SSLSocketFactory sf, URL url, Proxy proxy,
            int connectTimeout)
    throws IOException {
    PlatformLogger logger = HttpURLConnection.getHttpLogger();
    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
         logger.finest("Creating new HttpsClient with url:" + url + " and proxy:" + proxy +
         " with connect timeout:" + connectTimeout);
    }
    this.proxy = proxy;
    setSSLSocketFactory(sf);
    this.proxyDisabled = true;

    this.host = url.getHost();
    this.url = url;
    port = url.getPort();
    if (port == -1) {
        port = getDefaultPort();
    }
    setConnectTimeout(connectTimeout);
    openServer();
}
 
Example 2
Source File: InputContext.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private void logCreationFailed(Throwable throwable) {
    PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
    if (logger.isLoggable(PlatformLogger.Level.CONFIG)) {
        String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed",
                                                     "Could not create {0}. Reason: {1}");
        Object[] args =
            {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
             throwable.getLocalizedMessage()};
        MessageFormat mf = new MessageFormat(errorTextFormat);
        logger.config(mf.format(args));
    }
}
 
Example 3
Source File: Currency.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void info(String message, Throwable t) {
    PlatformLogger logger = PlatformLogger.getLogger("java.util.Currency");
    if (logger.isLoggable(PlatformLogger.Level.INFO)) {
        if (t != null) {
            logger.info(message, t);
        } else {
            logger.info(message);
        }
    }
}
 
Example 4
Source File: AWTAutoShutdown.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
final void dumpPeers(final PlatformLogger aLog) {
    if (aLog.isLoggable(PlatformLogger.Level.FINE)) {
        synchronized (activationLock) {
            synchronized (mainLock) {
                aLog.fine("Mapped peers:");
                for (Object key : peerMap.keySet()) {
                    aLog.fine(key + "->" + peerMap.get(key));
                }
            }
        }
    }
}
 
Example 5
Source File: Currency.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void info(String message, Throwable t) {
    PlatformLogger logger = PlatformLogger.getLogger("java.util.Currency");
    if (logger.isLoggable(PlatformLogger.Level.INFO)) {
        if (t != null) {
            logger.info(message, t);
        } else {
            logger.info(message);
        }
    }
}
 
Example 6
Source File: InputContext.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void logCreationFailed(Throwable throwable) {
    PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
    if (logger.isLoggable(PlatformLogger.Level.CONFIG)) {
        String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed",
                                                     "Could not create {0}. Reason: {1}");
        Object[] args =
            {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
             throwable.getLocalizedMessage()};
        MessageFormat mf = new MessageFormat(errorTextFormat);
        logger.config(mf.format(args));
    }
}
 
Example 7
Source File: Currency.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private static void info(String message, Throwable t) {
    PlatformLogger logger = PlatformLogger.getLogger("java.util.Currency");
    if (logger.isLoggable(PlatformLogger.Level.INFO)) {
        if (t != null) {
            logger.info(message, t);
        } else {
            logger.info(message);
        }
    }
}
 
Example 8
Source File: AWTAutoShutdown.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
final void dumpPeers(final PlatformLogger aLog) {
    if (aLog.isLoggable(PlatformLogger.Level.FINE)) {
        synchronized (activationLock) {
            synchronized (mainLock) {
                aLog.fine("Mapped peers:");
                for (Object key : peerMap.keySet()) {
                    aLog.fine(key + "->" + peerMap.get(key));
                }
            }
        }
    }
}
 
Example 9
Source File: InputContext.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void logCreationFailed(Throwable throwable) {
    PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
    if (logger.isLoggable(PlatformLogger.Level.CONFIG)) {
        String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed",
                                                     "Could not create {0}. Reason: {1}");
        Object[] args =
            {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
             throwable.getLocalizedMessage()};
        MessageFormat mf = new MessageFormat(errorTextFormat);
        logger.config(mf.format(args));
    }
}
 
Example 10
Source File: AWTAutoShutdown.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
final void dumpPeers(final PlatformLogger aLog) {
    if (aLog.isLoggable(PlatformLogger.Level.FINE)) {
        synchronized (activationLock) {
            synchronized (mainLock) {
                aLog.fine("Mapped peers:");
                for (Object key : peerMap.keySet()) {
                    aLog.fine(key + "->" + peerMap.get(key));
                }
            }
        }
    }
}
 
Example 11
Source File: NTLMAuthenticationProxy.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
static void finest(Exception e) {
    PlatformLogger logger = HttpURLConnection.getHttpLogger();
    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
        logger.finest("NTLMAuthenticationProxy: " + e);
    }
}
 
Example 12
Source File: Negotiator.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void finest(Exception e) {
    PlatformLogger logger = HttpURLConnection.getHttpLogger();
    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
        logger.finest("NegotiateAuthentication: " + e);
    }
}
 
Example 13
Source File: Negotiator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private static void finest(Exception e) {
    PlatformLogger logger = HttpURLConnection.getHttpLogger();
    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
        logger.finest("NegotiateAuthentication: " + e);
    }
}
 
Example 14
Source File: PlatformLoggerTest.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private static void checkLoggable(PlatformLogger logger, PlatformLogger.Level level, boolean expected) {
    if (logger.isLoggable(level) != expected) {
        throw new RuntimeException("logger " + logger.getName() + ": " + level +
            (expected ? " not loggable" : " loggable"));
    }
}
 
Example 15
Source File: Negotiator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void finest(Exception e) {
    PlatformLogger logger = HttpURLConnection.getHttpLogger();
    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
        logger.finest("NegotiateAuthentication: " + e);
    }
}
 
Example 16
Source File: PlatformLoggerTest.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void checkLoggable(PlatformLogger logger, PlatformLogger.Level level, boolean expected) {
    if (logger.isLoggable(level) != expected) {
        throw new RuntimeException("logger " + logger.getName() + ": " + level +
            (expected ? " not loggable" : " loggable"));
    }
}
 
Example 17
Source File: Negotiator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private static void finest(Exception e) {
    PlatformLogger logger = HttpURLConnection.getHttpLogger();
    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
        logger.finest("NegotiateAuthentication: " + e);
    }
}
 
Example 18
Source File: NTLMAuthenticationProxy.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
static void finest(Exception e) {
    PlatformLogger logger = HttpURLConnection.getHttpLogger();
    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
        logger.finest("NTLMAuthenticationProxy: " + e);
    }
}
 
Example 19
Source File: NTLMAuthenticationProxy.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
static void finest(Exception e) {
    PlatformLogger logger = HttpURLConnection.getHttpLogger();
    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
        logger.finest("NTLMAuthenticationProxy: " + e);
    }
}
 
Example 20
Source File: NTLMAuthenticationProxy.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
static void finest(Exception e) {
    PlatformLogger logger = HttpURLConnection.getHttpLogger();
    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
        logger.finest("NTLMAuthenticationProxy: " + e);
    }
}