Author: dpsenner Date: Wed Jun 5 08:05:32 2013 New Revision: 1489736 URL: http://svn.apache.org/r1489736 Log: LOG4NET-342 added the property Configured to ILog that allows to check if the repository was configured properly
Usecase: if (log.Configured == false) { throw new ConfigurationErrorsException("Log4net failed to initialize properly."); } Modified: logging/log4net/trunk/src/Core/LogImpl.cs logging/log4net/trunk/src/ILog.cs Modified: logging/log4net/trunk/src/Core/LogImpl.cs URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Core/LogImpl.cs?rev=1489736&r1=1489735&r2=1489736&view=diff ============================================================================== --- logging/log4net/trunk/src/Core/LogImpl.cs (original) +++ logging/log4net/trunk/src/Core/LogImpl.cs Wed Jun 5 08:05:32 2013 @@ -1254,6 +1254,22 @@ namespace log4net.Core get { return Logger.IsEnabledFor(m_levelFatal); } } + /// <summary> + /// Gets the falg that indicates if the repository of this Logger has been configured. + /// </summary> + /// <value> + /// <c>true</c> if the repository of this Logger has been configured. + /// </value> + /// <remarks> + /// <para> + /// Gets the falg that indicates if the repository of this Logger has been configured. + /// </para> + /// </remarks> + virtual public bool Configured + { + get { return Logger.Repository.Configured; } + } + #endregion Implementation of ILog #region Private Methods Modified: logging/log4net/trunk/src/ILog.cs URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/ILog.cs?rev=1489736&r1=1489735&r2=1489736&view=diff ============================================================================== --- logging/log4net/trunk/src/ILog.cs (original) +++ logging/log4net/trunk/src/ILog.cs Wed Jun 5 08:05:32 2013 @@ -956,5 +956,18 @@ namespace log4net /// <seealso cref="M:FatalFormat(IFormatProvider, string, object[])"/> /// <seealso cref="ILog.IsDebugEnabled"/> bool IsFatalEnabled { get; } + + /// <summary> + /// Gets the falg that indicates if the repository of this Logger has been configured. + /// </summary> + /// <value> + /// <c>true</c> if the repository of this Logger has been configured. + /// </value> + /// <remarks> + /// <para> + /// Gets the falg that indicates if the repository of this Logger has been configured. + /// </para> + /// </remarks> + bool Configured { get; } } }