Example usage for java.util.logging Logger logp

List of usage examples for java.util.logging Logger logp

Introduction

In this page you can find the example usage for java.util.logging Logger logp.

Prototype

public void logp(Level level, String sourceClass, String sourceMethod, Throwable thrown,
        Supplier<String> msgSupplier) 

Source Link

Document

Log a lazily constructed message, specifying source class and method, with associated Throwable information.

Usage

From source file:co.runrightfast.core.utils.JmxUtils.java

static void unregisterApplicationMBean(final String domain, final Class<?> mbeanType) {
    final MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
    try {/* w  w w  . j  av a 2 s .  com*/
        mbeanServer.unregisterMBean(applicationMBeanObjectName(domain, mbeanType));
    } catch (final InstanceNotFoundException | MBeanRegistrationException ex) {
        final Logger log = Logger.getLogger(JmxUtils.class.getName());
        log.logp(WARNING, JmxUtils.class.getName(), "unregisterApplicationMBean", "failed", ex);
    }
}

From source file:co.runrightfast.core.utils.LoggingUtils.java

/**
 * Helper for logging JSON messages//from   w w  w .  j a  v a  2 s  . c o m
 *
 * @param logger
 * @param level
 * @param className
 * @param method
 * @param message
 * @param exception
 */
static void log(@NonNull final Logger logger, final Level level, final String className, final String method,
        @NonNull final Supplier<JsonObject> message, @NonNull final Throwable exception) {
    logger.logp(level, className, method, exception, () -> message.get().toString());
}