// Copyright 2003-2004 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. namespace Apache.Avalon.Framework { using System; /// /// The Null Logger class. This is useful for implementations where you need /// to provide a logger to a utility class, but do not want any output from it. /// It also helps when you have a utility that does not have a logger to supply. /// public class NullLogger: ILogger { /// /// Creates a new NullLogger. /// public NullLogger() { } /// /// No-op. /// /// Ignored public void Debug(string message ) { } /// /// No-op. /// /// Ignored /// Ignored public void Debug(string message, Exception exception) { } /// /// No-op. /// /// Ignored /// Ignored public void Debug( string format, params Object[] args ) { } /// /// No-op. /// /// false public bool IsDebugEnabled { get { return false; } } /// /// No-op. /// /// Ignored public void Info( string message ) { } /// /// No-op. /// /// Ignored /// Ignored public void Info( string message, Exception exception) { } /// /// No-op. /// /// Ignored /// Ignored public void Info( string format, params Object[] args ) { } /// /// No-op. /// /// false public bool IsInfoEnabled { get { return false; } } /// /// No-op. /// /// Ignored public void Warn(string message ) { } /// /// No-op. /// /// Ignored /// Ignored public void Warn(string message, Exception exception) { } /// /// No-op. /// /// Ignored /// Ignored public void Warn( string format, params Object[] args ) { } /// /// No-op. /// /// false public bool IsWarnEnabled { get { return false; } } /// /// No-op. /// /// Ignored public void Error(string message ) { } /// /// No-op. /// /// Ignored /// Ignored public void Error(string message, Exception exception) { } /// /// No-op. /// /// Ignored /// Ignored public void Error( string format, params Object[] args ) { } /// /// No-op. /// /// false public bool IsErrorEnabled { get { return false; } } /// /// No-op. /// /// Ignored public void FatalError(string message ) { } /// /// No-op. /// /// Ignored /// Ignored public void FatalError(string message, Exception exception) { } /// /// No-op. /// /// Ignored /// Ignored public void FatalError( string format, params Object[] args ) { } /// /// No-op. /// /// false public bool IsFatalErrorEnabled { get { return false; } } /// /// Returns this NullLogger. /// /// Ignored /// This ILogger instance. public ILogger CreateChildLogger(string name ) { return this; } } }