< prev index next >

src/java.logging/share/classes/java/util/logging/Logger.java

Print this page
rev 51958 : 8211122: Reduce the number of internal classes made accessible to jdk.unsupported
Reviewed-by: alanb, dfuchs, kvn
   1 /*
   2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.util.logging;
  27 
  28 import java.lang.ref.WeakReference;
  29 import java.security.AccessController;
  30 import java.security.PrivilegedAction;
  31 import java.util.ArrayList;
  32 import java.util.Iterator;
  33 import java.util.Locale;
  34 import java.util.MissingResourceException;
  35 import java.util.Objects;
  36 import java.util.ResourceBundle;
  37 import java.util.concurrent.CopyOnWriteArrayList;
  38 import java.util.function.Supplier;
  39 
  40 import jdk.internal.misc.JavaUtilResourceBundleAccess;
  41 import jdk.internal.misc.SharedSecrets;
  42 import jdk.internal.reflect.CallerSensitive;
  43 import jdk.internal.reflect.Reflection;
  44 import static jdk.internal.logger.DefaultLoggerFinder.isSystem;
  45 
  46 /**
  47  * A Logger object is used to log messages for a specific
  48  * system or application component.  Loggers are normally named,
  49  * using a hierarchical dot-separated namespace.  Logger names
  50  * can be arbitrary strings, but they should normally be based on
  51  * the package name or class name of the logged component, such
  52  * as java.net or javax.swing.  In addition it is possible to create
  53  * "anonymous" Loggers that are not stored in the Logger namespace.
  54  * <p>
  55  * Logger objects may be obtained by calls on one of the getLogger
  56  * factory methods.  These will either create a new Logger or
  57  * return a suitable existing Logger. It is important to note that
  58  * the Logger returned by one of the {@code getLogger} factory methods
  59  * may be garbage collected at any time if a strong reference to the
  60  * Logger is not kept.
  61  * <p>


   1 /*
   2  * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.util.logging;
  27 
  28 import java.lang.ref.WeakReference;
  29 import java.security.AccessController;
  30 import java.security.PrivilegedAction;
  31 import java.util.ArrayList;
  32 import java.util.Iterator;
  33 import java.util.Locale;
  34 import java.util.MissingResourceException;
  35 import java.util.Objects;
  36 import java.util.ResourceBundle;
  37 import java.util.concurrent.CopyOnWriteArrayList;
  38 import java.util.function.Supplier;
  39 
  40 import jdk.internal.access.JavaUtilResourceBundleAccess;
  41 import jdk.internal.access.SharedSecrets;
  42 import jdk.internal.reflect.CallerSensitive;
  43 import jdk.internal.reflect.Reflection;
  44 import static jdk.internal.logger.DefaultLoggerFinder.isSystem;
  45 
  46 /**
  47  * A Logger object is used to log messages for a specific
  48  * system or application component.  Loggers are normally named,
  49  * using a hierarchical dot-separated namespace.  Logger names
  50  * can be arbitrary strings, but they should normally be based on
  51  * the package name or class name of the logged component, such
  52  * as java.net or javax.swing.  In addition it is possible to create
  53  * "anonymous" Loggers that are not stored in the Logger namespace.
  54  * <p>
  55  * Logger objects may be obtained by calls on one of the getLogger
  56  * factory methods.  These will either create a new Logger or
  57  * return a suitable existing Logger. It is important to note that
  58  * the Logger returned by one of the {@code getLogger} factory methods
  59  * may be garbage collected at any time if a strong reference to the
  60  * Logger is not kept.
  61  * <p>


< prev index next >