2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package org.apache.log4j.spi;
19 import org.apache.log4j.Level;
20 import org.apache.log4j.Category;
21 import org.apache.log4j.Logger;
22 import org.apache.log4j.Appender;
24 import java.util.Enumeration;
25 import java.util.Vector;
28 * No-operation implementation of LoggerRepository which is used when
29 * LogManager.repositorySelector is erroneously nulled during class reloading.
32 public final class NOPLoggerRepository implements LoggerRepository {
36 public void addHierarchyEventListener(final HierarchyEventListener listener) {
42 public boolean isDisabled(final int level) {
49 public void setThreshold(final Level level) {
55 public void setThreshold(final String val) {
61 public void emitNoAppenderWarning(final Category cat) {
67 public Level getThreshold() {
74 public Logger getLogger(final String name) {
75 return new NOPLogger(this, name);
81 public Logger getLogger(final String name, final LoggerFactory factory) {
82 return new NOPLogger(this, name);
88 public Logger getRootLogger() {
89 return new NOPLogger(this, "root");
95 public Logger exists(final String name) {
102 public void shutdown() {
108 public Enumeration getCurrentLoggers() {
109 return new Vector().elements();
115 public Enumeration getCurrentCategories() {
116 return getCurrentLoggers();
123 public void fireAddAppenderEvent(Category logger, Appender appender) {
129 public void resetConfiguration() {