Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Catel - Part 4 of n: Unit testing with Catel

, 28 Jan 2011 CPOL
This article explains how to write unit tests for MVVM using Catel.
Catel-04_01-unittesting.zip
src
Catel.Articles.04 - Unit testing
Models
Properties
Settings.settings
Resources
Images
add.png
delete.png
edit.png
group.png
UI
Data
Converters
ViewModels
Windows
Catel.Articles.04 - Unit testing.Test
Models
Properties
UI
ViewModels
Catel.Articles.Base
Data
Attributes
Properties
Settings.settings
Resources
Images
CatenaLogic.png
Preview.png
Run.png
ShowCode.png
UI
Controls
Helpers
ViewModels
Windows
Catel.Core
Attributes
ClassDiagrams
DataObjectBase.cd
SavableDataObjectBase.cd
Collections
Helpers
ComponentModel
Data
Attributes
Exceptions
Interfaces
Diagnostics
Extensions
Helpers
Exceptions
Helpers
IO
Exceptions
IoC
LLBLGen
Log4net
Appender
Extensions
Helpers
MVVM
Commands
Interfaces
Exceptions
Services
EventArgs
Exceptions
Interfaces
ViewModels
Attributes
Interfaces
Properties
Reflection
Exceptions
Extensions
Helpers
Runtime
Serialization
Attributes
Helpers
Security
Cryptography
Helpers
Catel.Examples.Models
Properties
Catel.Examples.PersonApplication
Properties
Settings.settings
Resources
Images
add.png
delete.png
edit.png
group.png
UI
Data
Converters
ViewModels
Windows
Catel.Examples.Silverlight
Properties
Resources
Images
add.png
delete.png
edit.png
group.png
UI
Data
Converters
Pages
ViewModels
Windows
Catel.Examples.Silverlight.Web
Catel.Examples.Silverlight.Web.csproj.user
ClientBin
Properties
Catel.FxCop
Catel.Silverlight
Diagnostics
log4net
Core
MVVM
Commands
Services
ViewModels
Properties
Catel.Core
Catel.Windows
Reflection
Themes
Generic
Assets
Old
Windows
Controls
Data
Converters
Helpers
Helpers
Catel.Silverlight.Test
Properties
Catel.Silverlight.Test.Web
Catel.Silverlight.Test.Web.csproj.user
ClientBin
Properties
Catel.snk
Catel.Templates.WpfApplication
Properties
Settings.settings
UI
Controls
ViewModels
Windows
Catel.Templates.WpfItemTemplates
Properties
UI
Controls
ViewModels
Windows
Catel.Test
Collections
Convert
Data
Helpers
IO
MVVM
UI
ViewModels
Properties
Reflection
Runtime
Serialization
Security
Cryptography
Test References
Catel.Windows.accessor
Windows
Data
Converters
Catel.vsmdi
Catel.Windows
ClassDiagrams
ViewModelBase.cd
Collections
Extensions
Helpers
MVVM
Commands
Services
Test
UI
ViewModels
Properties
Settings.settings
Resources
Images
Add.png
ClearOutput.png
Edit.png
Error.png
Loading.gif
Preview.png
Remove.png
Save.png
TipOfTheDay.png
Warning.png
Themes
Aero
ExpressionDark
Assets
Generic
Assets
Controls
Jetpack
Assets
background.png
Old
SunnyOrange
Assets
Windows
Controls
Extensions
LinkLabel
StackGrid
Data
Converters
Helpers
Documents
Extensions
Extensions
Helpers
Input
Markup
Media
Effects
EmptyEffect
EmptyEffect.fx
EmptyEffect.ps
EmptyEffect.fx
GrayscaleEffect
GrayscaleEffect.fx
GrayscaleEffect.ps
Extensions
Imaging
Extensions
Windows
DataWindow
TipOfTheDay
Local.testsettings
Settings.StyleCop
TraceAndTestImpact.testsettings
using System;
using log4net.Core;

namespace log4net
{
    /// <summary>
    /// This is a dummy implementation of the log4net ILog interface to allow Catel to compile.
    /// </summary>
    public class DummyLog : ILog
    {
        /// <summary>
        /// Log a message object with the <see cref="Level.Debug"/> level.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <overloads>Log a message object with the <see cref="Level.Debug"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// This method first checks if this logger is <c>DEBUG</c>
        /// enabled by comparing the level of this logger with the
        /// <see cref="Level.Debug"/> level. If this logger is
        /// <c>DEBUG</c> enabled, then it converts the message object
        /// (passed as parameter) to a string by invoking the appropriate
        /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
        /// proceeds to call all the registered appenders in this logger
        /// and also higher in the hierarchy depending on the value of
        /// the additivity flag.
        /// </para>
        /// 	<para><b>WARNING</b> Note that passing an <see cref="Exception"/>
        /// to this method will print the name of the <see cref="Exception"/>
        /// but no stack trace. To print a stack trace use the
        /// <see cref="Debug(object,Exception)"/> form instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Debug(object,Exception)"/>
        /// <seealso cref="IsDebugEnabled"/>
        public void Debug(object message)
        {
            
        }

        /// <summary>
        /// Log a message object with the <see cref="Level.Debug"/> level including
        /// the stack trace of the <see cref="Exception"/> passed
        /// as a parameter.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <param name="exception">The exception to log, including its stack trace.</param>
        /// <remarks>
        /// See the <see cref="Debug(object)"/> form for more detailed information.
        /// </remarks>
        /// <seealso cref="Debug(object)"/>
        /// <seealso cref="IsDebugEnabled"/>
        public void Debug(object message, Exception exception)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Debug"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <overloads>Log a formatted string with the <see cref="Level.Debug"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Debug(object)"/>
        /// <seealso cref="IsDebugEnabled"/>
        public void DebugFormat(string format, params object[] args)
        {
           
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Debug"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Debug(object)"/>
        /// <seealso cref="IsDebugEnabled"/>
        public void DebugFormat(string format, object arg0)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Debug"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Debug(object)"/>
        /// <seealso cref="IsDebugEnabled"/>
        public void DebugFormat(string format, object arg0, object arg1)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Debug"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <param name="arg2">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Debug(object)"/>
        /// <seealso cref="IsDebugEnabled"/>
        public void DebugFormat(string format, object arg0, object arg1, object arg2)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Debug"/> level.
        /// </summary>
        /// <param name="provider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information</param>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Debug(object)"/>
        /// <seealso cref="IsDebugEnabled"/>
        public void DebugFormat(IFormatProvider provider, string format, params object[] args)
        {
            
        }

        /// <summary>
        /// Logs a message object with the <see cref="Level.Info"/> level.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <overloads>Log a message object with the <see cref="Level.Info"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// This method first checks if this logger is <c>INFO</c>
        /// enabled by comparing the level of this logger with the
        /// <see cref="Level.Info"/> level. If this logger is
        /// <c>INFO</c> enabled, then it converts the message object
        /// (passed as parameter) to a string by invoking the appropriate
        /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
        /// proceeds to call all the registered appenders in this logger
        /// and also higher in the hierarchy depending on the value of the
        /// additivity flag.
        /// </para>
        /// 	<para><b>WARNING</b> Note that passing an <see cref="Exception"/>
        /// to this method will print the name of the <see cref="Exception"/>
        /// but no stack trace. To print a stack trace use the
        /// <see cref="Info(object,Exception)"/> form instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Info(object,Exception)"/>
        /// <seealso cref="IsInfoEnabled"/>
        public void Info(object message)
        {
            
        }

        /// <summary>
        /// Logs a message object with the <c>INFO</c> level including
        /// the stack trace of the <see cref="Exception"/> passed
        /// as a parameter.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <param name="exception">The exception to log, including its stack trace.</param>
        /// <remarks>
        /// See the <see cref="Info(object)"/> form for more detailed information.
        /// </remarks>
        /// <seealso cref="Info(object)"/>
        /// <seealso cref="IsInfoEnabled"/>
        public void Info(object message, Exception exception)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Info"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <overloads>Log a formatted message string with the <see cref="Level.Info"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Info(object,Exception)"/>
        /// <seealso cref="IsInfoEnabled"/>
        public void InfoFormat(string format, params object[] args)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Info"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Info(object)"/>
        /// <seealso cref="IsInfoEnabled"/>
        public void InfoFormat(string format, object arg0)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Info"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Info(object)"/>
        /// <seealso cref="IsInfoEnabled"/>
        public void InfoFormat(string format, object arg0, object arg1)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Info"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <param name="arg2">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Info(object)"/>
        /// <seealso cref="IsInfoEnabled"/>
        public void InfoFormat(string format, object arg0, object arg1, object arg2)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Info"/> level.
        /// </summary>
        /// <param name="provider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information</param>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Info(object,Exception)"/>
        /// <seealso cref="IsInfoEnabled"/>
        public void InfoFormat(IFormatProvider provider, string format, params object[] args)
        {
            
        }

        /// <summary>
        /// Log a message object with the <see cref="Level.Warn"/> level.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <overloads>Log a message object with the <see cref="Level.Warn"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// This method first checks if this logger is <c>WARN</c>
        /// enabled by comparing the level of this logger with the
        /// <see cref="Level.Warn"/> level. If this logger is
        /// <c>WARN</c> enabled, then it converts the message object
        /// (passed as parameter) to a string by invoking the appropriate
        /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
        /// proceeds to call all the registered appenders in this logger
        /// and also higher in the hierarchy depending on the value of the
        /// additivity flag.
        /// </para>
        /// 	<para><b>WARNING</b> Note that passing an <see cref="Exception"/>
        /// to this method will print the name of the <see cref="Exception"/>
        /// but no stack trace. To print a stack trace use the
        /// <see cref="Warn(object,Exception)"/> form instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Warn(object,Exception)"/>
        /// <seealso cref="IsWarnEnabled"/>
        public void Warn(object message)
        {
            
        }

        /// <summary>
        /// Log a message object with the <see cref="Level.Warn"/> level including
        /// the stack trace of the <see cref="Exception"/> passed
        /// as a parameter.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <param name="exception">The exception to log, including its stack trace.</param>
        /// <remarks>
        /// See the <see cref="Warn(object)"/> form for more detailed information.
        /// </remarks>
        /// <seealso cref="Warn(object)"/>
        /// <seealso cref="IsWarnEnabled"/>
        public void Warn(object message, Exception exception)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Warn"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <overloads>Log a formatted message string with the <see cref="Level.Warn"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Warn(object,Exception)"/>
        /// <seealso cref="IsWarnEnabled"/>
        public void WarnFormat(string format, params object[] args)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Warn"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Warn(object)"/>
        /// <seealso cref="IsWarnEnabled"/>
        public void WarnFormat(string format, object arg0)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Warn"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Warn(object)"/>
        /// <seealso cref="IsWarnEnabled"/>
        public void WarnFormat(string format, object arg0, object arg1)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Warn"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <param name="arg2">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Warn(object)"/>
        /// <seealso cref="IsWarnEnabled"/>
        public void WarnFormat(string format, object arg0, object arg1, object arg2)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Warn"/> level.
        /// </summary>
        /// <param name="provider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information</param>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Warn(object,Exception)"/>
        /// <seealso cref="IsWarnEnabled"/>
        public void WarnFormat(IFormatProvider provider, string format, params object[] args)
        {
            
        }

        /// <summary>
        /// Logs a message object with the <see cref="Level.Error"/> level.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <overloads>Log a message object with the <see cref="Level.Error"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// This method first checks if this logger is <c>ERROR</c>
        /// enabled by comparing the level of this logger with the
        /// <see cref="Level.Error"/> level. If this logger is
        /// <c>ERROR</c> enabled, then it converts the message object
        /// (passed as parameter) to a string by invoking the appropriate
        /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
        /// proceeds to call all the registered appenders in this logger
        /// and also higher in the hierarchy depending on the value of the
        /// additivity flag.
        /// </para>
        /// 	<para><b>WARNING</b> Note that passing an <see cref="Exception"/>
        /// to this method will print the name of the <see cref="Exception"/>
        /// but no stack trace. To print a stack trace use the
        /// <see cref="Error(object,Exception)"/> form instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Error(object,Exception)"/>
        /// <seealso cref="IsErrorEnabled"/>
        public void Error(object message)
        {
            
        }

        /// <summary>
        /// Log a message object with the <see cref="Level.Error"/> level including
        /// the stack trace of the <see cref="Exception"/> passed
        /// as a parameter.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <param name="exception">The exception to log, including its stack trace.</param>
        /// <remarks>
        /// See the <see cref="Error(object)"/> form for more detailed information.
        /// </remarks>
        /// <seealso cref="Error(object)"/>
        /// <seealso cref="IsErrorEnabled"/>
        public void Error(object message, Exception exception)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Error"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <overloads>Log a formatted message string with the <see cref="Level.Error"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Error(object)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Error(object,Exception)"/>
        /// <seealso cref="IsErrorEnabled"/>
        public void ErrorFormat(string format, params object[] args)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Error"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Error(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Error(object)"/>
        /// <seealso cref="IsErrorEnabled"/>
        public void ErrorFormat(string format, object arg0)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Error"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Error(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Error(object)"/>
        /// <seealso cref="IsErrorEnabled"/>
        public void ErrorFormat(string format, object arg0, object arg1)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Error"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <param name="arg2">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Error(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Error(object)"/>
        /// <seealso cref="IsErrorEnabled"/>
        public void ErrorFormat(string format, object arg0, object arg1, object arg2)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Error"/> level.
        /// </summary>
        /// <param name="provider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information</param>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Error(object)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Error(object,Exception)"/>
        /// <seealso cref="IsErrorEnabled"/>
        public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
        {
            
        }

        /// <summary>
        /// Log a message object with the <see cref="Level.Fatal"/> level.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <overloads>Log a message object with the <see cref="Level.Fatal"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// This method first checks if this logger is <c>FATAL</c>
        /// enabled by comparing the level of this logger with the
        /// <see cref="Level.Fatal"/> level. If this logger is
        /// <c>FATAL</c> enabled, then it converts the message object
        /// (passed as parameter) to a string by invoking the appropriate
        /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
        /// proceeds to call all the registered appenders in this logger
        /// and also higher in the hierarchy depending on the value of the
        /// additivity flag.
        /// </para>
        /// 	<para><b>WARNING</b> Note that passing an <see cref="Exception"/>
        /// to this method will print the name of the <see cref="Exception"/>
        /// but no stack trace. To print a stack trace use the
        /// <see cref="Fatal(object,Exception)"/> form instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Fatal(object,Exception)"/>
        /// <seealso cref="IsFatalEnabled"/>
        public void Fatal(object message)
        {
            
        }

        /// <summary>
        /// Log a message object with the <see cref="Level.Fatal"/> level including
        /// the stack trace of the <see cref="Exception"/> passed
        /// as a parameter.
        /// </summary>
        /// <param name="message">The message object to log.</param>
        /// <param name="exception">The exception to log, including its stack trace.</param>
        /// <remarks>
        /// See the <see cref="Fatal(object)"/> form for more detailed information.
        /// </remarks>
        /// <seealso cref="Fatal(object)"/>
        /// <seealso cref="IsFatalEnabled"/>
        public void Fatal(object message, Exception exception)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Fatal"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <overloads>Log a formatted message string with the <see cref="Level.Fatal"/> level.</overloads>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Fatal(object)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Fatal(object,Exception)"/>
        /// <seealso cref="IsFatalEnabled"/>
        public void FatalFormat(string format, params object[] args)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Fatal"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Fatal(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Fatal(object)"/>
        /// <seealso cref="IsFatalEnabled"/>
        public void FatalFormat(string format, object arg0)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Fatal"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Fatal(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Fatal(object)"/>
        /// <seealso cref="IsFatalEnabled"/>
        public void FatalFormat(string format, object arg0, object arg1)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Fatal"/> level.
        /// </summary>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="arg0">An object to format</param>
        /// <param name="arg1">An object to format</param>
        /// <param name="arg2">An object to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Fatal(object,Exception)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Fatal(object)"/>
        /// <seealso cref="IsFatalEnabled"/>
        public void FatalFormat(string format, object arg0, object arg1, object arg2)
        {
            
        }

        /// <summary>
        /// Logs a formatted message string with the <see cref="Level.Fatal"/> level.
        /// </summary>
        /// <param name="provider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information</param>
        /// <param name="format">A String containing zero or more format items</param>
        /// <param name="args">An object array containing zero or more objects to format</param>
        /// <remarks>
        /// 	<para>
        /// The message is formatted using the <c>String.Format</c> method. See
        /// <see cref="String.Format(string, object[])"/> for details of the syntax of the format string and the behavior
        /// of the formatting.
        /// </para>
        /// 	<para>
        /// This method does not take an <see cref="Exception"/> object to include in the
        /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Fatal(object)"/>
        /// methods instead.
        /// </para>
        /// </remarks>
        /// <seealso cref="Fatal(object,Exception)"/>
        /// <seealso cref="IsFatalEnabled"/>
        public void FatalFormat(IFormatProvider provider, string format, params object[] args)
        {
            
        }

        /// <summary>
        /// Checks if this logger is enabled for the <see cref="Level.Debug"/> level.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this logger is enabled for <see cref="Level.Debug"/> events, <c>false</c> otherwise.
        /// </value>
        /// <remarks>
        /// 	<para>
        /// This function is intended to lessen the computational cost of
        /// disabled log debug statements.
        /// </para>
        /// 	<para> For some ILog interface <c>log</c>, when you write:</para>
        /// 	<code lang="C#">
        /// log.Debug("This is entry number: " + i );
        /// </code>
        /// 	<para>
        /// You incur the cost constructing the message, string construction and concatenation in
        /// this case, regardless of whether the message is logged or not.
        /// </para>
        /// 	<para>
        /// If you are worried about speed (who isn't), then you should write:
        /// </para>
        /// 	<code lang="C#">
        /// if (log.IsDebugEnabled)
        /// {
        /// log.Debug("This is entry number: " + i );
        /// }
        /// </code>
        /// 	<para>
        /// This way you will not incur the cost of parameter
        /// construction if debugging is disabled for <c>log</c>. On
        /// the other hand, if the <c>log</c> is debug enabled, you
        /// will incur the cost of evaluating whether the logger is debug
        /// enabled twice. Once in <see cref="IsDebugEnabled"/> and once in
        /// the <see cref="Debug(object)"/>.  This is an insignificant overhead
        /// since evaluating a logger takes about 1% of the time it
        /// takes to actually log. This is the preferred style of logging.
        /// </para>
        /// 	<para>Alternatively if your logger is available statically then the is debug
        /// enabled state can be stored in a static variable like this:
        /// </para>
        /// 	<code lang="C#">
        /// private static readonly bool isDebugEnabled = log.IsDebugEnabled;
        /// </code>
        /// 	<para>
        /// Then when you come to log you can write:
        /// </para>
        /// 	<code lang="C#">
        /// if (isDebugEnabled)
        /// {
        /// log.Debug("This is entry number: " + i );
        /// }
        /// </code>
        /// 	<para>
        /// This way the debug enabled state is only queried once
        /// when the class is loaded. Using a <c>private static readonly</c>
        /// variable is the most efficient because it is a run time constant
        /// and can be heavily optimized by the JIT compiler.
        /// </para>
        /// 	<para>
        /// Of course if you use a static readonly variable to
        /// hold the enabled state of the logger then you cannot
        /// change the enabled state at runtime to vary the logging
        /// that is produced. You have to decide if you need absolute
        /// speed or runtime flexibility.
        /// </para>
        /// </remarks>
        /// <seealso cref="Debug(object)"/>
        /// <seealso cref="DebugFormat(IFormatProvider, string, object[])"/>
        public bool IsDebugEnabled
        {
            get { return false; }
        }

        /// <summary>
        /// Checks if this logger is enabled for the <see cref="Level.Info"/> level.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this logger is enabled for <see cref="Level.Info"/> events, <c>false</c> otherwise.
        /// </value>
        /// <remarks>
        /// For more information see <see cref="ILog.IsDebugEnabled"/>.
        /// </remarks>
        /// <seealso cref="Info(object)"/>
        /// <seealso cref="InfoFormat(IFormatProvider, string, object[])"/>
        /// <seealso cref="ILog.IsDebugEnabled"/>
        public bool IsInfoEnabled
        {
            get { return false; }
        }

        /// <summary>
        /// Checks if this logger is enabled for the <see cref="Level.Warn"/> level.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this logger is enabled for <see cref="Level.Warn"/> events, <c>false</c> otherwise.
        /// </value>
        /// <remarks>
        /// For more information see <see cref="ILog.IsDebugEnabled"/>.
        /// </remarks>
        /// <seealso cref="Warn(object)"/>
        /// <seealso cref="WarnFormat(IFormatProvider, string, object[])"/>
        /// <seealso cref="ILog.IsDebugEnabled"/>
        public bool IsWarnEnabled
        {
            get { return false; }
        }

        /// <summary>
        /// Checks if this logger is enabled for the <see cref="Level.Error"/> level.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this logger is enabled for <see cref="Level.Error"/> events, <c>false</c> otherwise.
        /// </value>
        /// <remarks>
        /// For more information see <see cref="ILog.IsDebugEnabled"/>.
        /// </remarks>
        /// <seealso cref="Error(object)"/>
        /// <seealso cref="ErrorFormat(IFormatProvider, string, object[])"/>
        /// <seealso cref="ILog.IsDebugEnabled"/>
        public bool IsErrorEnabled
        {
            get { return false; }
        }

        /// <summary>
        /// Checks if this logger is enabled for the <see cref="Level.Fatal"/> level.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this logger is enabled for <see cref="Level.Fatal"/> events, <c>false</c> otherwise.
        /// </value>
        /// <remarks>
        /// For more information see <see cref="ILog.IsDebugEnabled"/>.
        /// </remarks>
        /// <seealso cref="Fatal(object)"/>
        /// <seealso cref="FatalFormat(IFormatProvider, string, object[])"/>
        /// <seealso cref="ILog.IsDebugEnabled"/>
        public bool IsFatalEnabled
        {
            get { return false; }
        }

        /// <summary>
        /// Get the implementation behind this wrapper object.
        /// </summary>
        /// <value>
        /// The <see cref="ILogger"/> object that in implementing this object.
        /// </value>
        /// <remarks>
        /// The <see cref="ILogger"/> object that in implementing this
        /// object. The <c>Logger</c> object may not
        /// be the same object as this object because of logger decorators.
        /// This gets the actual underlying objects that is used to process
        /// the log events.
        /// </remarks>
        public ILogger Logger
        {
            get { return null; }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Geert van Horrik
Software Developer CatenaLogic
Netherlands Netherlands
I am Geert van Horrik, and I have studied Computer Science in the Netherlands.
 
I love to write software using .NET (especially the combination of WPF and C#). I am also the lead developer of Catel, an open-source application development framework for WPF, Silverlight, WP7 and WinRT with the focus on MVVM.
 
I have my own company since January 1st 2007, called CatenaLogic. This company develops commercial and non-commercial software.
 
To download (or buy) applications I have written, visit my website: http://www.catenalogic.com
Follow on   Twitter

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141220.1 | Last Updated 28 Jan 2011
Article Copyright 2011 by Geert van Horrik
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid