// 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; /// /// Supporting Logger levels. /// public enum LoggerLevel { /// /// Debug logging level /// Debug, /// /// Info logging level /// Info, /// /// Warn logging level /// Warn, /// /// Error logging level /// Error, /// /// Fatal logging level /// Fatal } /// /// This is a facade for the different logging subsystems. /// It offers a simplified interface that follows IOC patterns /// and a simplified priority/level/severity abstraction. /// public interface ILogger { /// /// Logs a debug message. /// /// The Message void Debug( string message ); /// /// Logs a debug message. /// /// The Message /// The Exception void Debug( string message, Exception exception); /// /// Logs a debug message. /// /// Message format /// Array of objects to write using format void Debug( string format, params Object[] args ); /// /// Determines if messages of priority "debug" will be logged. /// /// True if "debug" messages will be logged. bool IsDebugEnabled { get; } /// /// Logs an info message. /// /// The Message void Info( string message ); /// /// Logs an info message. /// /// The Message /// The Exception void Info( string message, Exception exception); /// /// Logs an info message. /// /// Message format /// Array of objects to write using format void Info( string format, params Object[] args ); /// /// Determines if messages of priority "info" will be logged. /// /// True if "info" messages will be logged. bool IsInfoEnabled { get; } /// /// Logs a warn message. /// /// The Message void Warn( string message ); /// /// Logs a warn message. /// /// The Message /// The Exception void Warn( string message, Exception exception); /// /// Logs a warn message. /// /// Message format /// Array of objects to write using format void Warn( string format, params Object[] args ); /// /// Determines if messages of priority "warn" will be logged. /// /// True if "warn" messages will be logged. bool IsWarnEnabled { get; } /// /// Logs an error message. /// /// The Message void Error( string message ); /// /// Logs an error message. /// /// The Message /// The Exception void Error( string message, Exception exception); /// /// Logs an error message. /// /// Message format /// Array of objects to write using format void Error( string format, params Object[] args ); /// /// Determines if messages of priority "error" will be logged. /// /// True if "error" messages will be logged. bool IsErrorEnabled { get; } /// /// Logs a fatal error message. /// /// The Message void FatalError( string message ); /// /// Logs a fatal error message. /// /// The Message /// The Exception void FatalError( string message, Exception exception); /// /// Logs a fatal error message. /// /// Message format /// Array of objects to write using format void FatalError( string format, params Object[] args ); /// /// Determines if messages of priority "fatalError" will be logged. /// /// True if "fatalError" messages will be logged. bool IsFatalErrorEnabled { get; } /// /// Create a new child logger. /// The name of the child logger is [current-loggers-name].[passed-in-name] /// /// The Subname of this logger. /// The New ILogger instance. /// If the name has an empty element name. ILogger CreateChildLogger( string name ); } }