nicko       2004/10/21 15:15:46

  Modified:    extensions/net/1.0/log4net.Ext.Trace/cs/src ITraceLog.cs
                        TraceLogImpl.cs
               src      ILog.cs
               src/Core Level.cs LevelMap.cs LogImpl.cs
               src/Layout SimpleLayout.cs XMLLayout.cs
                        XmlLayoutSchemaLog4j.cs
               src/Layout/Pattern LevelPatternConverter.cs
               src/Repository ILoggerRepository.cs
                        LoggerRepositorySkeleton.cs
               src/Repository/Hierarchy Hierarchy.cs LoggerKey.cs
                        XmlHierarchyConfigurator.cs
  Log:
  Update to allow Level configuration to be redefined in the repository 
LevelMap. This is now the authority on levels and the Level.Debug etc. values 
are just the default values.
  Levels now have a display name which can be configured to alias or localise 
levels in the output.
  The LogImpl looks up the level values to use from the LevelMap and listens 
for configuration changes.
  
  Revision  Changes    Path
  1.4       +1 -0      
logging-log4net/extensions/net/1.0/log4net.Ext.Trace/cs/src/ITraceLog.cs
  
  Index: ITraceLog.cs
  ===================================================================
  RCS file: 
/home/cvs/logging-log4net/extensions/net/1.0/log4net.Ext.Trace/cs/src/ITraceLog.cs,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ITraceLog.cs      19 Sep 2004 17:52:54 -0000      1.3
  +++ ITraceLog.cs      21 Oct 2004 22:15:45 -0000      1.4
  @@ -26,6 +26,7 @@
        {
                void Trace(object message);
                void Trace(object message, Exception t);
  +             void TraceFormat(string format, params object[] args); 
                bool IsTraceEnabled { get; }
        }
   }
  
  
  
  1.4       +29 -3     
logging-log4net/extensions/net/1.0/log4net.Ext.Trace/cs/src/TraceLogImpl.cs
  
  Index: TraceLogImpl.cs
  ===================================================================
  RCS file: 
/home/cvs/logging-log4net/extensions/net/1.0/log4net.Ext.Trace/cs/src/TraceLogImpl.cs,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TraceLogImpl.cs   19 Sep 2004 17:52:54 -0000      1.3
  +++ TraceLogImpl.cs   21 Oct 2004 22:15:45 -0000      1.4
  @@ -29,25 +29,51 @@
                /// </summary>
                private readonly static Type ThisDeclaringType = 
typeof(TraceLogImpl);
   
  +             /// <summary>
  +             /// The default value for the TRACE level
  +             /// </summary>
  +             private readonly static Level s_defaultLevelTrace = new 
Level(20000, "TRACE");
  +             
  +             /// <summary>
  +             /// The current value for the TRACE level
  +             /// </summary>
  +             private Level m_levelTrace;
  +             
  +
                public TraceLogImpl(ILogger logger) : base(logger)
                {
                }
   
  +             /// <summary>
  +             /// Lookup the current value of the TRACE level
  +             /// </summary>
  +             protected override void 
ReloadLevels(log4net.Repository.ILoggerRepository repository)
  +             {
  +                     base.ReloadLevels(repository);
  +
  +                     m_levelTrace = 
repository.LevelMap.LookupWithDefault(s_defaultLevelTrace);
  +             }
  +
                #region Implementation of ITraceLog
   
                public void Trace(object message)
                {
  -                     Logger.Log(ThisDeclaringType, Level.Trace, message, 
null);
  +                     Logger.Log(ThisDeclaringType, m_levelTrace, message, 
null);
                }
   
                public void Trace(object message, System.Exception t)
                {
  -                     Logger.Log(ThisDeclaringType, Level.Trace, message, t);
  +                     Logger.Log(ThisDeclaringType, m_levelTrace, message, t);
  +             }
  +
  +             public void TraceFormat(string format, params object[] args)
  +             {
  +                     Logger.Log(ThisDeclaringType, m_levelTrace, 
String.Format(format, args), null);
                }
   
                public bool IsTraceEnabled
                {
  -                     get { return Logger.IsEnabledFor(Level.Trace); }
  +                     get { return Logger.IsEnabledFor(m_levelTrace); }
                }
   
                #endregion Implementation of ITraceLog
  
  
  
  1.5       +6 -0      logging-log4net/src/ILog.cs
  
  Index: ILog.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/ILog.cs,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ILog.cs   29 Sep 2004 22:02:04 -0000      1.4
  +++ ILog.cs   21 Oct 2004 22:15:46 -0000      1.5
  @@ -37,6 +37,12 @@
        /// has properties for determining if those logging levels are
        /// enabled in the current configuration.
        /// </para>
  +     /// <para>
  +     /// This interface can be implemented in different ways. This 
documentation
  +     /// specifies reasonable behaviour that a caller can expect from the 
actual
  +     /// implementation, however different implementations reserve the right 
to
  +     /// do things differently.
  +     /// </para>
        /// </remarks>
        /// <example>Simple example of logging messages
        /// <code>
  
  
  
  1.5       +80 -20    logging-log4net/src/Core/Level.cs
  
  Index: Level.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Core/Level.cs,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Level.cs  2 Jun 2004 15:37:17 -0000       1.4
  +++ Level.cs  21 Oct 2004 22:15:46 -0000      1.5
  @@ -22,10 +22,37 @@
   namespace log4net.Core
   {
        /// <summary>
  -     /// Defines the set of levels recognized by the system.
  +     /// Defines the default set of levels recognized by the system.
        /// </summary>
        /// <remarks>
  -     /// Some of the predefined levels recognized by the system are
  +     /// <p>
  +     /// Each <see cref="LoggingEvent"/> has an associated <see 
cref="Level"/>.
  +     /// </p>
  +     /// <p>
  +     /// Levels have a numeric <see cref="Level.Value"/> that defines the 
relative 
  +     /// ordering between levels. Two Levels with the same <see 
cref="Level.Value"/> 
  +     /// are demmed to be equivalent.
  +     /// </p>
  +     /// <p>
  +     /// The levels that are recognised by log4net are set for each <see 
cref="log4net.Repository.ILoggerRepository"/>
  +     /// and each repository can have different levels defined. The levels 
are stored
  +     /// in the <see cref="log4net.Repository.ILoggerRepository.LevelMap"/> 
on the repository. Levels are
  +     /// looked up by name from the <see 
cref="log4net.Repository.ILoggerRepository.LevelMap"/>.
  +     /// </p>
  +     /// <p>
  +     /// When logging at level INFO the actual level used is not <see 
cref="Level.Info"/> but
  +     /// the value of <c>LoggerRepository.LevelMap["INFO"]</c>. The default 
value for this is
  +     /// <see cref="Level.Info"/>, but this can be changed by reconfiguring 
the level map.
  +     /// </p>
  +     /// <p>
  +     /// Each level has a <see cref="DisplayName"/> in addition to its <see 
cref="Name"/>. The 
  +     /// <see cref="DisplayName"/> is the string that is written into the 
output log. By default
  +     /// the display name is the same as the level name, but this can be 
used to alias levels
  +     /// or to localise the log output.
  +     /// </p>
  +     /// <p>
  +     /// Some of the predefined levels recognized by the system are:
  +     /// </p>
        /// <list type="bullet">
        ///             <item>
        ///                     <description><see cref="Off"/>.</description>
  @@ -65,10 +92,31 @@
                /// </summary>
                /// <param name="level">Integer value for this level, higher 
values represent more severe levels.</param>
                /// <param name="levelName">The string name of this 
level.</param>
  -             public Level(int level, string levelName) 
  +             /// <param name="displayName">The display name for this level. 
This may be localised or otherwise different from the name</param>
  +             public Level(int level, string levelName, string displayName) 
  +             {
  +                     if (levelName == null)
  +                     {
  +                             throw new ArgumentNullException("levelName");
  +                     }
  +                     if (displayName == null)
  +                     {
  +                             throw new ArgumentNullException("displayName");
  +                     }
  +
  +                     m_levelValue = level;
  +                     m_levelName = string.Intern(levelName);
  +                     m_levelDisplayName = displayName;
  +             }
  +
  +             /// <summary>
  +             /// Initializes a new instance of the <see cref="Level" /> 
class with
  +             /// the specified level name and value.
  +             /// </summary>
  +             /// <param name="level">Integer value for this level, higher 
values represent more severe levels.</param>
  +             /// <param name="levelName">The string name of this 
level.</param>
  +             public Level(int level, string levelName) : this(level, 
levelName, levelName)
                {
  -                     m_level = level;
  -                     m_levelStr = string.Intern(levelName);
                }
   
                #endregion Public Instance Constructors
  @@ -83,7 +131,7 @@
                /// </value>
                public string Name
                {
  -                     get { return m_levelStr; }
  +                     get { return m_levelName; }
                }
   
                /// <summary>
  @@ -94,7 +142,18 @@
                /// </value>
                public int Value
                {
  -                     get { return m_level; }
  +                     get { return m_levelValue; }
  +             }
  +
  +             /// <summary>
  +             /// Gets the display name of the level.
  +             /// </summary>
  +             /// <value>
  +             /// The display name of the level.
  +             /// </value>
  +             public string DisplayName
  +             {
  +                     get { return m_levelDisplayName; }
                }
   
                #endregion Public Instance Properties
  @@ -110,7 +169,7 @@
                /// </returns>
                override public string ToString() 
                {
  -                     return m_levelStr;
  +                     return m_levelName;
                }
   
                /// <summary>
  @@ -122,9 +181,10 @@
                /// <returns><c>true</c> if the objects are equal.</returns>
                override public bool Equals(object o)
                {
  -                     if (o != null && o is Level)
  +                     Level otherLevel = o as Level;
  +                     if (otherLevel != null)
                        {
  -                             return m_level == ((Level)o).m_level;
  +                             return m_levelValue == otherLevel.m_levelValue;
                        }
                        else
                        {
  @@ -139,7 +199,7 @@
                /// <returns>A hash code for the current <see cref="Level" 
/>.</returns>
                override public int GetHashCode()
                {
  -                     return m_level;
  +                     return m_levelValue;
                }
   
                #endregion Override implementation of Object
  @@ -209,7 +269,7 @@
                /// </returns>
                public static bool operator > (Level l, Level r)
                {
  -                     return l.m_level > r.m_level;
  +                     return l.m_levelValue > r.m_levelValue;
                }
   
                /// <summary>
  @@ -224,7 +284,7 @@
                /// </returns>
                public static bool operator < (Level l, Level r)
                {
  -                     return l.m_level < r.m_level;
  +                     return l.m_levelValue < r.m_levelValue;
                }
   
                /// <summary>
  @@ -239,7 +299,7 @@
                /// </returns>
                public static bool operator >= (Level l, Level r)
                {
  -                     return l.m_level >= r.m_level;
  +                     return l.m_levelValue >= r.m_levelValue;
                }
   
                /// <summary>
  @@ -254,7 +314,7 @@
                /// </returns>
                public static bool operator <= (Level l, Level r)
                {
  -                     return l.m_level <= r.m_level;
  +                     return l.m_levelValue <= r.m_levelValue;
                }
   
                /// <summary>
  @@ -271,7 +331,7 @@
                {
                        if (((object)l) != null && ((object)r) != null)
                        {
  -                             return l.m_level == r.m_level;
  +                             return l.m_levelValue == r.m_levelValue;
                        }
                        else
                        {
  @@ -340,7 +400,7 @@
                                return 1;
                        }
   
  -                     return l.m_level - r.m_level;
  +                     return l.m_levelValue - r.m_levelValue;
                }
   
                #endregion Public Static Methods
  @@ -451,10 +511,10 @@
   
                #region Private Instance Fields
   
  -             private readonly int m_level;
  -             private readonly string m_levelStr;
  +             private readonly int m_levelValue;
  +             private readonly string m_levelName;
  +             private readonly string m_levelDisplayName;
   
                #endregion Private Instance Fields
  -
        }
   }
  
  
  
  1.6       +65 -24    logging-log4net/src/Core/LevelMap.cs
  
  Index: LevelMap.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Core/LevelMap.cs,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LevelMap.cs       7 Jun 2004 01:06:43 -0000       1.5
  +++ LevelMap.cs       21 Oct 2004 22:15:46 -0000      1.6
  @@ -43,10 +43,10 @@
                /// </summary>
                private Hashtable m_mapName2Level = new 
Hashtable(CaseInsensitiveHashCodeProvider.Default, 
CaseInsensitiveComparer.Default);
   
  -             /// <summary>
  -             /// Mapping from level value to Level object
  -             /// </summary>
  -             private Hashtable m_mapValue2Level = new Hashtable();
  +//           /// <summary>
  +//           /// Mapping from level value to Level object
  +//           /// </summary>
  +//           private Hashtable m_mapValue2Level = new Hashtable();
   
                #endregion
   
  @@ -70,7 +70,7 @@
                {
                        // Clear all current levels
                        m_mapName2Level.Clear();
  -                     m_mapValue2Level.Clear();
  +//                   m_mapValue2Level.Clear();
                }
   
                /// <summary>
  @@ -99,25 +99,35 @@
                        }
                }
   
  +//           /// <summary>
  +//           /// Lookup a <see cref="Level"/> by value
  +//           /// </summary>
  +//           /// <param name="value">The value of the Level to lookup</param>
  +//           /// <returns>a Level from the map with the value 
specified</returns>
  +//           /// <remarks>
  +//           /// Returns the <see cref="Level"/> from the
  +//           /// map with the value specified. If the no level is
  +//           /// found then <c>null</c> is returned.
  +//           /// </remarks>
  +//           public Level this[int value]
  +//           {
  +//                   get
  +//                   {
  +//                           lock(this)
  +//                           {
  +//                                   return (Level)m_mapValue2Level[value];
  +//                           }
  +//                   }
  +//           }
  +
                /// <summary>
  -             /// Lookup a <see cref="Level"/> by value
  +             /// Create a new Level and add it to the map
                /// </summary>
  -             /// <param name="value">The value of the Level to lookup</param>
  -             /// <returns>a Level from the map with the value 
specified</returns>
  -             /// <remarks>
  -             /// Returns the <see cref="Level"/> from the
  -             /// map with the value specified. If the no level is
  -             /// found then <c>null</c> is returned.
  -             /// </remarks>
  -             public Level this[int value]
  +             /// <param name="name">the string to display for the 
Level</param>
  +             /// <param name="value">the level value to give to the 
Level</param>
  +             public void Add(string name, int value)
                {
  -                     get
  -                     {
  -                             lock(this)
  -                             {
  -                                     return (Level)m_mapValue2Level[value];
  -                             }
  -                     }
  +                     Add(name, value, null);
                }
   
                /// <summary>
  @@ -125,7 +135,8 @@
                /// </summary>
                /// <param name="name">the string to display for the 
Level</param>
                /// <param name="value">the level value to give to the 
Level</param>
  -             public void Add(string name, int value)
  +             /// <param name="displayName">the display name to give to the 
Level</param>
  +             public void Add(string name, int value, string displayName)
                {
                        if (name == null)
                        {
  @@ -136,7 +147,12 @@
                                throw 
log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("name", name, 
"Parameter: name, Value: ["+name+"] out of range. Level name must not be 
empty");
                        }
   
  -                     Add(new Level(value, name));
  +                     if (displayName == null || displayName.Length == 0)
  +                     {
  +                             displayName = name;
  +                     }
  +
  +                     Add(new Level(value, name, displayName));
                }
   
                /// <summary>
  @@ -152,7 +168,7 @@
                        lock(this)
                        {
                                m_mapName2Level[level.Name] = level;
  -                             m_mapValue2Level[level.Value] = level;
  +//                           m_mapValue2Level[level.Value] = level;
                        }
                }
   
  @@ -168,6 +184,31 @@
                                {
                                        return new 
LevelCollection(m_mapName2Level.Values);
                                }
  +                     }
  +             }
  +
  +             /// <summary>
  +             /// Lookup a named level from the map
  +             /// </summary>
  +             /// <param name="defaultLevel">the name of the level to lookup 
is taken from this level. 
  +             /// If the level is not set on the map then this level is 
added</param>
  +             /// <returns>the level in the map with the name 
specified</returns>
  +             public Level LookupWithDefault(Level defaultLevel)
  +             {
  +                     if (defaultLevel == null)
  +                     {
  +                             throw new ArgumentNullException("defaultLevel");
  +                     }
  +
  +                     lock(this)
  +                     {
  +                             Level level = 
(Level)m_mapName2Level[defaultLevel.Name];
  +                             if (level == null)
  +                             {
  +                                     m_mapName2Level[defaultLevel.Name] = 
defaultLevel;
  +                                     return defaultLevel;
  +                             }
  +                             return level;
                        }
                }
   
  
  
  
  1.5       +155 -45   logging-log4net/src/Core/LogImpl.cs
  
  Index: LogImpl.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Core/LogImpl.cs,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LogImpl.cs        29 Sep 2004 22:02:04 -0000      1.4
  +++ LogImpl.cs        21 Oct 2004 22:15:46 -0000      1.5
  @@ -18,6 +18,8 @@
   
   using System;
   
  +using log4net.Repository;
  +
   namespace log4net.Core
   {
        /// <summary>
  @@ -28,6 +30,66 @@
        /// This implementation of the <see cref="ILog"/> interface
        /// forwards to the <see cref="ILogger"/> held by the base class.
        /// </para>
  +     /// <para>
  +     /// This logger has methods to allow the caller to log at the following
  +     /// levels:
  +     /// </para>
  +     /// <list type="definition">
  +     ///   <item>
  +     ///     <term>DEBUG</term>
  +     ///     <description>
  +     ///     The <see cref="Debug"/> and <see cref="DebugFormat"/> methods 
log messages
  +     ///     at the <c>DEBUG</c> level. That is the level with that name 
defined in the
  +     ///     repositories <see cref="ILoggerRepository.LevelMap"/>. The 
default value
  +     ///     for this level is <see cref="Level.Debug"/>. The <see 
cref="IsDebugEnabled"/>
  +     ///     property tests if this level is enabled for logging.
  +     ///     </description>
  +     ///   </item>
  +     ///   <item>
  +     ///     <term>INFO</term>
  +     ///     <description>
  +     ///     The <see cref="Info"/> and <see cref="InfoFormat"/> methods log 
messages
  +     ///     at the <c>INFO</c> level. That is the level with that name 
defined in the
  +     ///     repositories <see cref="ILoggerRepository.LevelMap"/>. The 
default value
  +     ///     for this level is <see cref="Level.Info"/>. The <see 
cref="IsInfoEnabled"/>
  +     ///     property tests if this level is enabled for logging.
  +     ///     </description>
  +     ///   </item>
  +     ///   <item>
  +     ///     <term>WARN</term>
  +     ///     <description>
  +     ///     The <see cref="Warn"/> and <see cref="WarnFormat"/> methods log 
messages
  +     ///     at the <c>WARN</c> level. That is the level with that name 
defined in the
  +     ///     repositories <see cref="ILoggerRepository.LevelMap"/>. The 
default value
  +     ///     for this level is <see cref="Level.Warn"/>. The <see 
cref="IsWarnEnabled"/>
  +     ///     property tests if this level is enabled for logging.
  +     ///     </description>
  +     ///   </item>
  +     ///   <item>
  +     ///     <term>ERROR</term>
  +     ///     <description>
  +     ///     The <see cref="Error"/> and <see cref="ErrorFormat"/> methods 
log messages
  +     ///     at the <c>ERROR</c> level. That is the level with that name 
defined in the
  +     ///     repositories <see cref="ILoggerRepository.LevelMap"/>. The 
default value
  +     ///     for this level is <see cref="Level.Error"/>. The <see 
cref="IsErrorEnabled"/>
  +     ///     property tests if this level is enabled for logging.
  +     ///     </description>
  +     ///   </item>
  +     ///   <item>
  +     ///     <term>FATAL</term>
  +     ///     <description>
  +     ///     The <see cref="Fatal"/> and <see cref="FatalFormat"/> methods 
log messages
  +     ///     at the <c>FATAL</c> level. That is the level with that name 
defined in the
  +     ///     repositories <see cref="ILoggerRepository.LevelMap"/>. The 
default value
  +     ///     for this level is <see cref="Level.Fatal"/>. The <see 
cref="IsFatalEnabled"/>
  +     ///     property tests if this level is enabled for logging.
  +     ///     </description>
  +     ///   </item>
  +     /// </list>
  +     /// <para>
  +     /// The values for these levels and their semantic meanings can be 
changed by 
  +     /// configuring the <see cref="ILoggerRepository.LevelMap"/> for the 
repository.
  +     /// </para>
        /// </remarks>
        /// <author>Nicko Cadell</author>
        /// <author>Gert Driesen</author>
  @@ -41,21 +103,41 @@
                /// <param name="logger">The logger to wrap.</param>
                public LogImpl(ILogger logger) : base(logger)
                {
  +                     // Listen for changes to the repository
  +                     logger.Repository.ConfigurationChanged += new 
LoggerRepositoryConfigurationChangedEventHandler(LoggerRepositoryConfigurationChanged);
  +
  +                     // load the current levels
  +                     ReloadLevels(logger.Repository);
                }
   
                #endregion Public Instance Constructors
   
  +             /// <summary>
  +             /// Virtual method called when the configuration of the 
repository changes
  +             /// </summary>
  +             /// <param name="repository">the repository holding the 
levels</param>
  +             protected virtual void ReloadLevels(ILoggerRepository 
repository)
  +             {
  +                     LevelMap levelMap = repository.LevelMap;
  +
  +                     m_levelDebug = levelMap.LookupWithDefault(Level.Debug);
  +                     m_levelInfo = levelMap.LookupWithDefault(Level.Info);
  +                     m_levelWarn = levelMap.LookupWithDefault(Level.Warn);
  +                     m_levelError = levelMap.LookupWithDefault(Level.Error);
  +                     m_levelFatal = levelMap.LookupWithDefault(Level.Fatal);
  +             }
  +
                #region Implementation of ILog
   
                /// <summary>
  -             /// Logs a message object with the <see cref="Level.Debug"/> 
level.
  +             /// Logs a message object with the <c>DEBUG</c> level.
                /// </summary>
                /// <param name="message">The message object to log.</param>
                /// <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> 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 
  @@ -72,7 +154,7 @@
                /// </remarks>
                virtual public void Debug(object message) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Debug, message, 
null);
  +                     Logger.Log(ThisDeclaringType, m_levelDebug, message, 
null);
                }
   
                /// <summary>
  @@ -88,11 +170,11 @@
                /// <seealso cref="Debug(object)"/>
                virtual public void Debug(object message, Exception t) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Debug, message, t);
  +                     Logger.Log(ThisDeclaringType, m_levelDebug, message, t);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Debug"/> level.
  +             /// Logs a formatted message string with the <c>DEBUG</c> 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>
  @@ -110,11 +192,11 @@
                /// </remarks>
                virtual public void DebugFormat(string format, params object[] 
args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Debug, 
String.Format(format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelDebug, 
String.Format(format, args), null);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Debug"/> level.
  +             /// Logs a formatted message string with the <c>DEBUG</c> 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>
  @@ -133,18 +215,18 @@
                /// </remarks>
                virtual public void DebugFormat(IFormatProvider provider, 
string format, params object[] args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Debug, 
String.Format(provider, format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelDebug, 
String.Format(provider, format, args), null);
                }
   
                /// <summary>
  -             /// Logs a message object with the <see cref="Level.Info"/> 
level.
  +             /// Logs a message object with the <c>INFO</c> level.
                /// </summary>
                /// <param name="message">The message object to log.</param>
                /// <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> 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 
  @@ -161,7 +243,7 @@
                /// </remarks>
                virtual public void Info(object message) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Info, message, 
null);
  +                     Logger.Log(ThisDeclaringType, m_levelInfo, message, 
null);
                }
     
                /// <summary>
  @@ -177,11 +259,11 @@
                /// <seealso cref="Info(object)"/>
                virtual public void Info(object message, Exception t) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Info, message, t);
  +                     Logger.Log(ThisDeclaringType, m_levelInfo, message, t);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Info"/> level.
  +             /// Logs a formatted message string with the <c>INFO</c> 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>
  @@ -199,11 +281,11 @@
                /// </remarks>
                virtual public void InfoFormat(string format, params object[] 
args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Info, 
String.Format(format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelInfo, 
String.Format(format, args), null);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Info"/> level.
  +             /// Logs a formatted message string with the <c>INFO</c> 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>
  @@ -222,18 +304,18 @@
                /// </remarks>
                virtual public void InfoFormat(IFormatProvider provider, string 
format, params object[] args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Info, 
String.Format(provider, format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelInfo, 
String.Format(provider, format, args), null);
                }
   
                /// <summary>
  -             /// Logs a message object with the <see cref="Level.Warn"/> 
level.
  +             /// Logs a message object with the <c>WARN</c> level.
                /// </summary>
                /// <param name="message">the message object to log</param>
                /// <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> 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 
  @@ -250,7 +332,7 @@
                /// </remarks>
                virtual public void Warn(object message) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Warn, message, 
null);
  +                     Logger.Log(ThisDeclaringType, m_levelWarn, message, 
null);
                }
     
                /// <summary>
  @@ -266,11 +348,11 @@
                /// <seealso cref="Warn(object)"/>
                virtual public void Warn(object message, Exception t) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Warn, message, t);
  +                     Logger.Log(ThisDeclaringType, m_levelWarn, message, t);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Warn"/> level.
  +             /// Logs a formatted message string with the <c>WARN</c> 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>
  @@ -288,11 +370,11 @@
                /// </remarks>
                virtual public void WarnFormat(string format, params object[] 
args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Warn, 
String.Format(format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelWarn, 
String.Format(format, args), null);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Warn"/> level.
  +             /// Logs a formatted message string with the <c>WARN</c> 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>
  @@ -311,18 +393,18 @@
                /// </remarks>
                virtual public void WarnFormat(IFormatProvider provider, string 
format, params object[] args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Warn, 
String.Format(provider, format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelWarn, 
String.Format(provider, format, args), null);
                }
   
                /// <summary>
  -             /// Logs a message object with the <see cref="Level.Error"/> 
level.
  +             /// Logs a message object with the <c>ERROR</c> level.
                /// </summary>
                /// <param name="message">The message object to log.</param>
                /// <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> 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 
  @@ -339,7 +421,7 @@
                /// </remarks>
                virtual public void Error(object message) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Error, message, 
null);
  +                     Logger.Log(ThisDeclaringType, m_levelError, message, 
null);
                }
   
                /// <summary>
  @@ -355,11 +437,11 @@
                /// <seealso cref="Error(object)"/>
                virtual public void Error(object message, Exception t) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Error, message, t);
  +                     Logger.Log(ThisDeclaringType, m_levelError, message, t);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Error"/> level.
  +             /// Logs a formatted message string with the <c>ERROR</c> 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>
  @@ -377,11 +459,11 @@
                /// </remarks>
                virtual public void ErrorFormat(string format, params object[] 
args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Error, 
String.Format(format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelError, 
String.Format(format, args), null);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Error"/> level.
  +             /// Logs a formatted message string with the <c>ERROR</c> 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>
  @@ -400,18 +482,18 @@
                /// </remarks>
                virtual public void ErrorFormat(IFormatProvider provider, 
string format, params object[] args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Error, 
String.Format(provider, format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelError, 
String.Format(provider, format, args), null);
                }
   
                /// <summary>
  -             /// Logs a message object with the <see cref="Level.Fatal"/> 
level.
  +             /// Logs a message object with the <c>FATAL</c> level.
                /// </summary>
                /// <param name="message">The message object to log.</param>
                /// <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> 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 
  @@ -428,7 +510,7 @@
                /// </remarks>
                virtual public void Fatal(object message) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Fatal, message, 
null);
  +                     Logger.Log(ThisDeclaringType, m_levelFatal, message, 
null);
                }
     
                /// <summary>
  @@ -444,11 +526,11 @@
                /// <seealso cref="Fatal(object)"/>
                virtual public void Fatal(object message, Exception t) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Fatal, message, t);
  +                     Logger.Log(ThisDeclaringType, m_levelFatal, message, t);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Fatal"/> level.
  +             /// Logs a formatted message string with the <c>FATAL</c> 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>
  @@ -466,11 +548,11 @@
                /// </remarks>
                virtual public void FatalFormat(string format, params object[] 
args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Fatal, 
String.Format(format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelFatal, 
String.Format(format, args), null);
                }
   
                /// <summary>
  -             /// Logs a formatted message string with the <see 
cref="Level.Fatal"/> level.
  +             /// Logs a formatted message string with the <c>FATAL</c> 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>
  @@ -489,7 +571,7 @@
                /// </remarks>
                virtual public void FatalFormat(IFormatProvider provider, 
string format, params object[] args) 
                {
  -                     Logger.Log(ThisDeclaringType, Level.Fatal, 
String.Format(provider, format, args), null);
  +                     Logger.Log(ThisDeclaringType, m_levelFatal, 
String.Format(provider, format, args), null);
                }
   
                /// <summary>
  @@ -537,7 +619,7 @@
                /// </remarks>
                virtual public bool IsDebugEnabled
                {
  -                     get { return Logger.IsEnabledFor(Level.Debug); }
  +                     get { return Logger.IsEnabledFor(m_levelDebug); }
                }
     
                /// <summary>
  @@ -554,7 +636,7 @@
                /// <seealso cref="LogImpl.IsDebugEnabled"/>
                virtual public bool IsInfoEnabled
                {
  -                     get { return Logger.IsEnabledFor(Level.Info); }
  +                     get { return Logger.IsEnabledFor(m_levelInfo); }
                }
   
                /// <summary>
  @@ -571,7 +653,7 @@
                /// <seealso cref="ILog.IsDebugEnabled"/>
                virtual public bool IsWarnEnabled
                {
  -                     get { return Logger.IsEnabledFor(Level.Warn); }
  +                     get { return Logger.IsEnabledFor(m_levelWarn); }
                }
   
                /// <summary>
  @@ -587,7 +669,7 @@
                /// <seealso cref="ILog.IsDebugEnabled"/>
                virtual public bool IsErrorEnabled
                {
  -                     get { return Logger.IsEnabledFor(Level.Error); }
  +                     get { return Logger.IsEnabledFor(m_levelError); }
                }
   
                /// <summary>
  @@ -603,11 +685,29 @@
                /// <seealso cref="ILog.IsDebugEnabled"/>
                virtual public bool IsFatalEnabled
                {
  -                     get { return Logger.IsEnabledFor(Level.Fatal); }
  +                     get { return Logger.IsEnabledFor(m_levelFatal); }
                }
   
                #endregion Implementation of ILog
   
  +             #region Private Methods
  +
  +             /// <summary>
  +             /// Event handler for the <see 
cref="log4net.Repository.ILoggerRepository.ConfigurationChanged"/> event
  +             /// </summary>
  +             /// <param name="sender">the repository</param>
  +             /// <param name="e">Empty</param>
  +             private void LoggerRepositoryConfigurationChanged(object 
sender, EventArgs e)
  +             {
  +                     ILoggerRepository repository = sender as 
ILoggerRepository;
  +                     if (repository != null)
  +                     {
  +                             ReloadLevels(repository);
  +                     }
  +             }
  +
  +             #endregion
  +
                #region Private Static Instance Fields
   
                /// <summary>
  @@ -616,5 +716,15 @@
                private readonly static Type ThisDeclaringType = 
typeof(LogImpl);
   
                #endregion Private Static Instance Fields
  +
  +             #region Private Fields
  +
  +             private Level m_levelDebug;
  +             private Level m_levelInfo;
  +             private Level m_levelWarn;
  +             private Level m_levelError;
  +             private Level m_levelFatal;
  +
  +             #endregion
        }
   }
  
  
  
  1.6       +1 -1      logging-log4net/src/Layout/SimpleLayout.cs
  
  Index: SimpleLayout.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Layout/SimpleLayout.cs,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SimpleLayout.cs   10 Sep 2004 19:40:23 -0000      1.5
  +++ SimpleLayout.cs   21 Oct 2004 22:15:46 -0000      1.6
  @@ -92,7 +92,7 @@
                                throw new ArgumentNullException("loggingEvent");
                        }
   
  -                     writer.Write(loggingEvent.Level.Name);
  +                     writer.Write(loggingEvent.Level.DisplayName);
                        writer.Write(" - ");
                        loggingEvent.WriteRenderedMessage(writer);
                        writer.WriteLine();
  
  
  
  1.8       +1 -1      logging-log4net/src/Layout/XMLLayout.cs
  
  Index: XMLLayout.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Layout/XMLLayout.cs,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLLayout.cs      9 Sep 2004 21:53:13 -0000       1.7
  +++ XMLLayout.cs      21 Oct 2004 22:15:46 -0000      1.8
  @@ -175,7 +175,7 @@
                        writer.WriteStartElement(m_elmEvent);
                        writer.WriteAttributeString(ATTR_LOGGER, 
loggingEvent.LoggerName);
                        writer.WriteAttributeString(ATTR_TIMESTAMP, 
XmlConvert.ToString(loggingEvent.TimeStamp));
  -                     writer.WriteAttributeString(ATTR_LEVEL, 
loggingEvent.Level.ToString());
  +                     writer.WriteAttributeString(ATTR_LEVEL, 
loggingEvent.Level.DisplayName);
                        writer.WriteAttributeString(ATTR_THREAD, 
loggingEvent.ThreadName);
   
                        if (loggingEvent.Domain != null && 
loggingEvent.Domain.Length > 0)
  
  
  
  1.8       +1 -1      logging-log4net/src/Layout/XmlLayoutSchemaLog4j.cs
  
  Index: XmlLayoutSchemaLog4j.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Layout/XmlLayoutSchemaLog4j.cs,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XmlLayoutSchemaLog4j.cs   9 Sep 2004 21:53:13 -0000       1.7
  +++ XmlLayoutSchemaLog4j.cs   21 Oct 2004 22:15:46 -0000      1.8
  @@ -177,7 +177,7 @@
                        TimeSpan timeSince1970 = 
loggingEvent.TimeStamp.ToUniversalTime() - s_date1970;
   
                        writer.WriteAttributeString("timestamp", 
XmlConvert.ToString((long)timeSince1970.TotalMilliseconds));
  -                     writer.WriteAttributeString("level", 
loggingEvent.Level.ToString());
  +                     writer.WriteAttributeString("level", 
loggingEvent.Level.DisplayName);
                        writer.WriteAttributeString("thread", 
loggingEvent.ThreadName);
       
                        // Append the message text
  
  
  
  1.3       +1 -1      
logging-log4net/src/Layout/Pattern/LevelPatternConverter.cs
  
  Index: LevelPatternConverter.cs
  ===================================================================
  RCS file: 
/home/cvs/logging-log4net/src/Layout/Pattern/LevelPatternConverter.cs,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LevelPatternConverter.cs  16 Feb 2004 02:10:53 -0000      1.2
  +++ LevelPatternConverter.cs  21 Oct 2004 22:15:46 -0000      1.3
  @@ -38,7 +38,7 @@
                /// <returns>the relevant location information</returns>
                override protected void Convert(TextWriter writer, LoggingEvent 
loggingEvent)
                {
  -                     writer.Write( loggingEvent.Level.ToString() );
  +                     writer.Write( loggingEvent.Level.DisplayName );
                }
        }
   }
  
  
  
  1.5       +21 -2     logging-log4net/src/Repository/ILoggerRepository.cs
  
  Index: ILoggerRepository.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Repository/ILoggerRepository.cs,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ILoggerRepository.cs      1 Oct 2004 20:59:38 -0000       1.4
  +++ ILoggerRepository.cs      21 Oct 2004 22:15:46 -0000      1.5
  @@ -41,7 +41,7 @@
   
        #endregion
   
  -     #region LoggerRepositoryConfigurationResetEvent
  +     #region LoggerRepositoryConfigurationResetEventHandler
   
        /// <summary>
        /// Delegate used to handle logger repository configuration reset event 
notifications
  @@ -55,6 +55,17 @@
        public delegate void 
LoggerRepositoryConfigurationResetEventHandler(object sender, EventArgs e);
   
        #endregion
  +
  +     #region LoggerRepositoryConfigurationChangedEventHandler
  +
  +     /// <summary>
  +     /// Delegate used to handle event notifications for logger repository 
configuration changes.
  +     /// </summary>
  +     /// <param name="sender">The <see cref="ILoggerRepository"/> that has 
had its configuration changed.</param>
  +     /// <param name="e">Empty event arguments.</param>
  +     public delegate void 
LoggerRepositoryConfigurationChangedEventHandler(object sender, EventArgs e);
  +
  +     #endregion
        
        /// <summary>
        /// Interface implemented by logger repositories.
  @@ -230,7 +241,15 @@
                /// <value>
                /// Event to notify that the repository has had its 
configuration reset.
                /// </value>
  -             event LoggerRepositoryConfigurationResetEventHandler 
ConfigurationResetEvent;
  +             event LoggerRepositoryConfigurationResetEventHandler 
ConfigurationReset;
  +
  +             /// <summary>
  +             /// Event to notify that the repository has had its 
configuration changed.
  +             /// </summary>
  +             /// <value>
  +             /// Event to notify that the repository has had its 
configuration changed.
  +             /// </value>
  +             event LoggerRepositoryConfigurationChangedEventHandler 
ConfigurationChanged;
   
                /// <summary>
                /// Repository specific properties
  
  
  
  1.8       +59 -6     
logging-log4net/src/Repository/LoggerRepositorySkeleton.cs
  
  Index: LoggerRepositorySkeleton.cs
  ===================================================================
  RCS file: 
/home/cvs/logging-log4net/src/Repository/LoggerRepositorySkeleton.cs,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LoggerRepositorySkeleton.cs       1 Oct 2004 20:59:38 -0000       1.7
  +++ LoggerRepositorySkeleton.cs       21 Oct 2004 22:15:46 -0000      1.8
  @@ -46,6 +46,7 @@
                private bool m_configured;
                private event LoggerRepositoryShutdownEventHandler 
m_shutdownEvent;
                private event LoggerRepositoryConfigurationResetEventHandler 
m_configurationResetEvent;
  +             private event LoggerRepositoryConfigurationChangedEventHandler 
m_configurationChangedEvent;
                private PropertiesDictionary m_properties;
   
                #endregion
  @@ -215,7 +216,7 @@
                        }
   
                        // Notify listeners
  -                     OnShutdownEvent();
  +                     OnShutdown(null);
                }
   
                /// <summary>
  @@ -242,7 +243,7 @@
                        Configured = false;
   
                        // Notify listeners
  -                     OnConfigurationResetEvent();
  +                     OnConfigurationReset(null);
                }
   
                /// <summary>
  @@ -293,13 +294,25 @@
                /// <value>
                /// Event to notify that the repository has had its 
configuration reset.
                /// </value>
  -             public event LoggerRepositoryConfigurationResetEventHandler 
ConfigurationResetEvent
  +             public event LoggerRepositoryConfigurationResetEventHandler 
ConfigurationReset
                {
                        add { m_configurationResetEvent += value; }
                        remove { m_configurationResetEvent -= value; }
                }
   
                /// <summary>
  +             /// Event to notify that the repository has had its 
configuration changed.
  +             /// </summary>
  +             /// <value>
  +             /// Event to notify that the repository has had its 
configuration changed.
  +             /// </value>
  +             public event LoggerRepositoryConfigurationChangedEventHandler 
ConfigurationChanged
  +             {
  +                     add { m_configurationChangedEvent += value; }
  +                     remove { m_configurationChangedEvent -= value; }
  +             }
  +
  +             /// <summary>
                /// Repository specific properties
                /// </summary>
                /// <remarks>
  @@ -374,25 +387,65 @@
                /// <summary>
                /// Notify the registered listeners that the repository is 
shutting down
                /// </summary>
  -             protected virtual void OnShutdownEvent()
  +             protected virtual void OnShutdown(EventArgs e)
                {
  +                     if (e == null)
  +                     {
  +                             e = EventArgs.Empty;
  +                     }
  +
                        LoggerRepositoryShutdownEventHandler handler = 
m_shutdownEvent;
                        if (handler != null)
                        {
  -                             handler(this, EventArgs.Empty);
  +                             handler(this, e);
                        }
                }
   
                /// <summary>
                /// Notify the registered listeners that the repository has had 
its configuration reset
                /// </summary>
  -             protected virtual void OnConfigurationResetEvent()
  +             protected virtual void OnConfigurationReset(EventArgs e)
                {
  +                     if (e == null)
  +                     {
  +                             e = EventArgs.Empty;
  +                     }
  +
                        LoggerRepositoryConfigurationResetEventHandler handler 
= m_configurationResetEvent;
                        if (handler != null)
                        {
  +                             handler(this, e);
  +                     }
  +             }
  +
  +             /// <summary>
  +             /// Notify the registered listeners that the repository has had 
its configuration changed
  +             /// </summary>
  +             protected virtual void OnConfigurationChanged(EventArgs e)
  +             {
  +                     if (e == null)
  +                     {
  +                             e = EventArgs.Empty;
  +                     }
  +
  +                     LoggerRepositoryConfigurationChangedEventHandler 
handler = m_configurationChangedEvent;
  +                     if (handler != null)
  +                     {
                                handler(this, EventArgs.Empty);
                        }
  +             }
  +
  +             /// <summary>
  +             /// Raise a configuration changed event on this repository
  +             /// </summary>
  +             /// <param name="e">EventArgs.Empty</param>
  +             /// <remarks>
  +             /// Applications that programatically change the configuration 
of the repository should
  +             /// raise this event notification to notify listeners.
  +             /// </remarks>
  +             public void RaiseConfigurationChanged(EventArgs e)
  +             {
  +                     OnConfigurationChanged(e);
                }
        }
   }
  
  
  
  1.7       +80 -39    logging-log4net/src/Repository/Hierarchy/Hierarchy.cs
  
  Index: Hierarchy.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Repository/Hierarchy/Hierarchy.cs,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Hierarchy.cs      1 Oct 2004 20:59:38 -0000       1.6
  +++ Hierarchy.cs      21 Oct 2004 22:15:46 -0000      1.7
  @@ -71,17 +71,6 @@
   
        #endregion LoggerCreationEvent
   
  -     #region HierarchyConfigurationChangedEvent
  -
  -     /// <summary>
  -     /// Delegate used to handle event notifications for hierarchy 
configuration changes.
  -     /// </summary>
  -     /// <param name="sender">The <see cref="Hierarchy"/> that has had its 
configuration changed.</param>
  -     /// <param name="e">Empty event arguments.</param>
  -     public delegate void HierarchyConfigurationChangedEventHandler(object 
sender, EventArgs e);
  -
  -     #endregion HierarchyConfigurationChangedEvent
  -
        /// <summary>
        /// This class is specialized in retrieving loggers by name and
        /// also maintaining the logger hierarchy. Implements the 
  @@ -117,18 +106,6 @@
                        remove { m_loggerCreatedEvent -= value; }
                }
   
  -             /// <summary>
  -             /// Event to notify that the hierarchy has had its 
configuration changed.
  -             /// </summary>
  -             /// <value>
  -             /// Event to notify that the hierarchy has had its 
configuration changed.
  -             /// </value>
  -             public event HierarchyConfigurationChangedEventHandler 
ConfigurationChangedEvent
  -             {
  -                     add { m_configurationChangedEvent += value; }
  -                     remove { m_configurationChangedEvent -= value; }
  -             }
  -
                #endregion Public Events
   
                #region Public Instance Constructors
  @@ -363,6 +340,9 @@
                        }
   
                        base.ResetConfiguration();
  +
  +                     // Notify listeners
  +                     OnConfigurationChanged(null);
                }
   
                /// <summary>
  @@ -442,7 +422,7 @@
                        Configured = true;
   
                        // Notify listeners
  -                     OnConfigurationChangedEvent();
  +                     OnConfigurationChanged(null);
                }
   
                #endregion Implementation of IBasicRepositoryConfigurator
  @@ -477,7 +457,7 @@
                        Configured = true;
   
                        // Notify listeners
  -                     OnConfigurationChangedEvent();
  +                     OnConfigurationChanged(null);
                }
   
                #endregion Implementation of IXmlRepositoryConfigurator
  @@ -609,18 +589,6 @@
                #region Protected Instance Methods
   
                /// <summary>
  -             /// Notify the registered listeners that the hierarchy has had 
its configuration changed
  -             /// </summary>
  -             protected virtual void OnConfigurationChangedEvent()
  -             {
  -                     HierarchyConfigurationChangedEventHandler handler = 
m_configurationChangedEvent;
  -                     if (handler != null)
  -                     {
  -                             handler(this, EventArgs.Empty);
  -                     }
  -             }
  -
  -             /// <summary>
                /// Sends a logger creation event to all registered listeners
                /// </summary>
                /// <param name="logger">The newly created logger</param>
  @@ -739,7 +707,81 @@
                                        childLogger.Parent = log;         
                                }
                        }
  -             }       
  +             }
  +
  +             /// <summary>
  +             /// Define or redefine a Level using the values in the <see 
cref="LevelEntry"/> argument
  +             /// </summary>
  +             /// <param name="levelEntry">the level values</param>
  +             internal void AddLevel(LevelEntry levelEntry)
  +             {
  +                     if (levelEntry == null) throw new 
ArgumentNullException("levelEntry");
  +                     if (levelEntry.Name == null) throw new 
ArgumentNullException("levelEntry.Name");
  +
  +                     // Lookup replacement value
  +                     if (levelEntry.Value == -1)
  +                     {
  +                             Level previousLevel = LevelMap[levelEntry.Name];
  +                             if (previousLevel == null)
  +                             {
  +                                     throw new 
InvalidOperationException("Cannot redefine level ["+levelEntry.Name+"] because 
it is not defined in the LevelMap. To define the level supply the level 
value.");
  +                             }
  +
  +                             levelEntry.Value = previousLevel.Value;
  +                     }
  +
  +                     LevelMap.Add(levelEntry.Name, levelEntry.Value, 
levelEntry.DisplayName);
  +             }
  +
  +             /// <summary>
  +             /// A class to hold the value, name and display name for a 
logging event
  +             /// </summary>
  +             internal class LevelEntry
  +             {
  +                     private int m_levelValue = -1;
  +                     private string m_levelName = null;
  +                     private string m_levelDisplayName = null;
  +
  +                     /// <summary>
  +                     /// Value of the level
  +                     /// </summary>
  +                     /// <remarks>
  +                     /// If the value is not set (defaults to -1) the value 
will be looked
  +                     /// up for the current level with the same name.
  +                     /// </remarks>
  +                     public int Value
  +                     {
  +                             get { return m_levelValue; }
  +                             set { m_levelValue = value; }
  +                     }
  +
  +                     /// <summary>
  +                     /// Name of the level
  +                     /// </summary>
  +                     public string Name
  +                     {
  +                             get { return m_levelName; }
  +                             set { m_levelName = value; }
  +                     }
  +
  +                     /// <summary>
  +                     /// Display name for the level
  +                     /// </summary>
  +                     public string DisplayName
  +                     {
  +                             get { return m_levelDisplayName; }
  +                             set { m_levelDisplayName = value; }
  +                     }
  +
  +                     /// <summary>
  +                     /// Override ToString to return sensible debug info
  +                     /// </summary>
  +                     /// <returns>string info about this object</returns>
  +                     public override string ToString()
  +                     {
  +                             return "LevelEntry(Value="+m_levelValue+", 
Name="+m_levelName+", DisplayName="+m_levelDisplayName+")";
  +                     }
  +             }
   
                #endregion Private Instance Methods
   
  @@ -752,7 +794,6 @@
     
                private bool m_emittedNoAppenderWarning = false;
                private event LoggerCreationEventHandler m_loggerCreatedEvent;
  -             private event HierarchyConfigurationChangedEventHandler 
m_configurationChangedEvent;
   
                #endregion Private Instance Fields
        }
  
  
  
  1.4       +7 -4      logging-log4net/src/Repository/Hierarchy/LoggerKey.cs
  
  Index: LoggerKey.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Repository/Hierarchy/LoggerKey.cs,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LoggerKey.cs      2 Jun 2004 16:20:46 -0000       1.3
  +++ LoggerKey.cs      21 Oct 2004 22:15:46 -0000      1.4
  @@ -67,17 +67,20 @@
                /// <c>true</c> if the specified <see cref="object" /> is equal 
to the current <see cref="LoggerKey" />; otherwise, <c>false</c>.</returns>
                override public bool Equals(object obj) 
                {
  -                     if (this == obj)
  +                     // Compare reference type of this against argument
  +                     if (((object)this) == obj)
                        {
                                return true;
                        }
  -                     if ((obj != null) && (obj is LoggerKey)) 
  +                     
  +                     LoggerKey objKey = obj as LoggerKey;
  +                     if (objKey != null) 
                        {
   #if NETCF
  -                             return m_name == ((LoggerKey)obj).m_name;
  +                             return ( m_name == objKey.m_name );
   #else
                                // Compare reference types rather than string's 
overloaded ==
  -                             return ((object)m_name) == 
((object)((LoggerKey)obj).m_name);
  +                             return ( ((object)m_name) == 
((object)objKey.m_name) );
   #endif
                        }
                        return false;
  
  
  
  1.12      +39 -11    
logging-log4net/src/Repository/Hierarchy/XmlHierarchyConfigurator.cs
  
  Index: XmlHierarchyConfigurator.cs
  ===================================================================
  RCS file: 
/home/cvs/logging-log4net/src/Repository/Hierarchy/XmlHierarchyConfigurator.cs,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XmlHierarchyConfigurator.cs       1 Oct 2004 21:02:16 -0000       1.11
  +++ XmlHierarchyConfigurator.cs       21 Oct 2004 22:15:46 -0000      1.12
  @@ -506,7 +506,7 @@
                        MethodInfo methInfo = null;
   
                        // Try to find a writable property
  -                     propInfo = targetType.GetProperty(name, 
BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase);
  +                     propInfo = targetType.GetProperty(name, 
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | 
BindingFlags.IgnoreCase);
                        if (propInfo != null && propInfo.CanWrite)
                        {
                                // found a property
  @@ -611,16 +611,30 @@
                                                        // Got a converted 
result
                                                        
LogLog.Debug("XmlConfigurator: Setting Property [" + propInfo.Name + "] to " + 
convertedValue.GetType().Name + " value [" + convertedValue.ToString() + "]");
   
  -                                                     // Pass to the property
  -                                                     
propInfo.SetValue(target, convertedValue, BindingFlags.SetProperty, null, null, 
CultureInfo.InvariantCulture);
  +                                                     try
  +                                                     {
  +                                                             // Pass to the 
property
  +                                                             
propInfo.SetValue(target, convertedValue, BindingFlags.SetProperty, null, null, 
CultureInfo.InvariantCulture);
  +                                                     }
  +                                                     
catch(TargetInvocationException targetInvocationEx)
  +                                                     {
  +                                                             
LogLog.Error("XmlConfigurator: Failed to set parameter [" + propInfo.Name + "] 
on object [" + target + "] using value [" + convertedValue + "]", 
targetInvocationEx.InnerException);
  +                                                     }
                                                }
                                                else if (methInfo != null)
                                                {
                                                        // Got a converted 
result
                                                        
LogLog.Debug("XmlConfigurator: Setting Collection Property [" + methInfo.Name + 
"] to " + convertedValue.GetType().Name + " value [" + 
convertedValue.ToString() + "]");
   
  -                                                     // Pass to the property
  -                                                     methInfo.Invoke(target, 
BindingFlags.InvokeMethod, null, new object[] {convertedValue}, 
CultureInfo.InvariantCulture);
  +                                                     try
  +                                                     {
  +                                                             // Pass to the 
property
  +                                                             
methInfo.Invoke(target, BindingFlags.InvokeMethod, null, new object[] 
{convertedValue}, CultureInfo.InvariantCulture);
  +                                                     }
  +                                                     
catch(TargetInvocationException targetInvocationEx)
  +                                                     {
  +                                                             
LogLog.Error("XmlConfigurator: Failed to set parameter [" + name + "] on object 
[" + target + "] using value [" + convertedValue + "]", 
targetInvocationEx.InnerException);
  +                                                     }
                                                }
                                        }
                                        else
  @@ -650,16 +664,30 @@
                                                        // Got a converted 
result
                                                        
LogLog.Debug("XmlConfigurator: Setting Property ["+ propInfo.Name +"] to object 
["+ createdObject +"]");
   
  -                                                     // Pass to the property
  -                                                     
propInfo.SetValue(target, createdObject, BindingFlags.SetProperty, null, null, 
CultureInfo.InvariantCulture);
  +                                                     try
  +                                                     {
  +                                                             // Pass to the 
property
  +                                                             
propInfo.SetValue(target, createdObject, BindingFlags.SetProperty, null, null, 
CultureInfo.InvariantCulture);
  +                                                     }
  +                                                     
catch(TargetInvocationException targetInvocationEx)
  +                                                     {
  +                                                             
LogLog.Error("XmlConfigurator: Failed to set parameter [" + propInfo.Name + "] 
on object [" + target + "] using value [" + createdObject + "]", 
targetInvocationEx.InnerException);
  +                                                     }
                                                }
                                                else if (methInfo != null)
                                                {
                                                        // Got a converted 
result
                                                        
LogLog.Debug("XmlConfigurator: Setting Collection Property ["+ methInfo.Name 
+"] to object ["+ createdObject +"]");
   
  -                                                     // Pass to the property
  -                                                     methInfo.Invoke(target, 
BindingFlags.InvokeMethod, null, new object[] {createdObject}, 
CultureInfo.InvariantCulture);
  +                                                     try
  +                                                     {
  +                                                             // Pass to the 
property
  +                                                             
methInfo.Invoke(target, BindingFlags.InvokeMethod, null, new object[] 
{createdObject}, CultureInfo.InvariantCulture);
  +                                                     }
  +                                                     
catch(TargetInvocationException targetInvocationEx)
  +                                                     {
  +                                                             
LogLog.Error("XmlConfigurator: Failed to set parameter [" + methInfo.Name + "] 
on object [" + target + "] using value [" + createdObject + "]", 
targetInvocationEx.InnerException);
  +                                                     }
                                                }
                                        }
                                }
  @@ -682,11 +710,11 @@
                        string requiredMethodNameA = name;
                        string requiredMethodNameB = "Add" + name;
   
  -                     MethodInfo[] methods = 
targetType.GetMethods(BindingFlags.Instance | BindingFlags.Public);
  +                     MethodInfo[] methods = 
targetType.GetMethods(BindingFlags.Instance | BindingFlags.Public | 
BindingFlags.NonPublic);
   
                        foreach(MethodInfo methInfo in methods)
                        {
  -                             if (methInfo.IsPublic && !methInfo.IsStatic)
  +                             if (!methInfo.IsStatic)
                                {
                                        if (string.Compare(methInfo.Name, 
requiredMethodNameA, true, System.Globalization.CultureInfo.InvariantCulture) 
== 0 ||
                                                string.Compare(methInfo.Name, 
requiredMethodNameB, true, System.Globalization.CultureInfo.InvariantCulture) 
== 0)
  
  
  

Reply via email to