/* * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package sun.util.logging; import java.lang.System.Logger; import java.util.ResourceBundle; import java.util.function.Supplier; import sun.util.logger.LoggerWrapper; import sun.util.logging.PlatformLogger.Level; /** * Platform logger provides an API for the JRE components to log * messages. * * The PlatformLoggerBridge interface is implemented by the System.Logger * objects returned by our default JUL provider - so that JRE classes using * PlatformLogger see no difference when JUL is the actual backend. * * The recommendation for JRE classes going forward is to use * java.lang.System.getLogger(String name), which will * use Lazy Loggers when possible and necessary. * * PlatformLogger is now only a thin adaptation layer over the same * loggers than returned by java.lang.System.getLogger(String name). * * @since 1.9 */ public interface ConfigurableLoggerBridge { public abstract class LoggerConfiguration { public abstract Level getPlatformLevel(); public abstract void setPlatformLevel(Level level); } public default LoggerConfiguration getLoggerConfiguration() { return null; } public static LoggerConfiguration getLoggerConfiguration(PlatformLoggerBridge logger) { if (logger instanceof ConfigurableLoggerBridge) { return ((ConfigurableLoggerBridge) logger).getLoggerConfiguration(); } else { return null; } } }