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.Appender;
20 import org.apache.log4j.Level;
21 import org.apache.log4j.Logger;
22 import org.apache.log4j.Priority;
24 import java.util.Enumeration;
25 import java.util.ResourceBundle;
26 import java.util.Vector;
29 * No-operation implementation of Logger used by NOPLoggerRepository.
32 public final class NOPLogger extends Logger {
34 * Create instance of Logger.
35 * @param repo repository, may not be null.
36 * @param name name, may not be null, use "root" for root logger.
38 public NOPLogger(NOPLoggerRepository repo, final String name) {
40 this.repository = repo;
41 this.level = Level.OFF;
46 public void addAppender(final Appender newAppender) {
50 public void assertLog(final boolean assertion, final String msg) {
55 public void callAppenders(final LoggingEvent event) {
59 void closeNestedAppenders() {
63 public void debug(final Object message) {
68 public void debug(final Object message, final Throwable t) {
72 public void error(final Object message) {
76 public void error(final Object message, final Throwable t) {
81 public void fatal(final Object message) {
85 public void fatal(final Object message, final Throwable t) {
90 public Enumeration getAllAppenders() {
91 return new Vector().elements();
95 public Appender getAppender(final String name) {
100 public Level getEffectiveLevel() {
105 public Priority getChainedPriority() {
106 return getEffectiveLevel();
110 public ResourceBundle getResourceBundle() {
116 public void info(final Object message) {
120 public void info(final Object message, final Throwable t) {
124 public boolean isAttached(Appender appender) {
129 public boolean isDebugEnabled() {
134 public boolean isEnabledFor(final Priority level) {
139 public boolean isInfoEnabled() {
145 public void l7dlog(final Priority priority, final String key, final Throwable t) {
149 public void l7dlog(final Priority priority, final String key, final Object[] params, final Throwable t) {
153 public void log(final Priority priority, final Object message, final Throwable t) {
157 public void log(final Priority priority, final Object message) {
161 public void log(final String callerFQCN, final Priority level, final Object message, final Throwable t) {
165 public void removeAllAppenders() {
170 public void removeAppender(Appender appender) {
174 public void removeAppender(final String name) {
178 public void setLevel(final Level level) {
183 public void setPriority(final Priority priority) {
187 public void setResourceBundle(final ResourceBundle bundle) {
191 public void warn(final Object message) {
195 public void warn(final Object message, final Throwable t) {
199 public void trace(Object message) {
203 public void trace(Object message, Throwable t) {
207 public boolean isTraceEnabled() {