http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Plugin/PluginMap.cs ---------------------------------------------------------------------- diff --git a/src/Plugin/PluginMap.cs b/src/Plugin/PluginMap.cs index d05223f..d561600 100644 --- a/src/Plugin/PluginMap.cs +++ b/src/Plugin/PluginMap.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -46,7 +46,7 @@ namespace log4net.Plugin /// <param name="repository">The repository that the plugins should be attached to.</param> /// <remarks> /// <para> - /// Initialize a new instance of the <see cref="PluginMap" /> class with a + /// Initialize a new instance of the <see cref="PluginMap" /> class with a /// repository that the plugins should be attached to. /// </para> /// </remarks> @@ -64,7 +64,7 @@ namespace log4net.Plugin /// </summary> /// <param name="name">The name of the <see cref="IPlugin" /> to lookup.</param> /// <returns> - /// The <see cref="IPlugin" /> from the map with the name specified, or + /// The <see cref="IPlugin" /> from the map with the name specified, or /// <c>null</c> if no plugin is found. /// </returns> /// <remarks> @@ -108,7 +108,7 @@ namespace log4net.Plugin } } } - + #endregion Public Instance Properties #region Public Instance Methods @@ -122,7 +122,7 @@ namespace log4net.Plugin /// The <see cref="IPlugin" /> will be attached to the repository when added. /// </para> /// <para> - /// If there already exists a plugin with the same name + /// If there already exists a plugin with the same name /// attached to the repository then the old plugin will /// be <see cref="IPlugin.Shutdown"/> and replaced with /// the new plugin.
http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Plugin/PluginSkeleton.cs ---------------------------------------------------------------------- diff --git a/src/Plugin/PluginSkeleton.cs b/src/Plugin/PluginSkeleton.cs index 56ce5c3..e949e92 100644 --- a/src/Plugin/PluginSkeleton.cs +++ b/src/Plugin/PluginSkeleton.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -66,12 +66,12 @@ namespace log4net.Plugin /// repository must be a unique name. /// </para> /// <para> - /// The name of the plugin must not change one the + /// The name of the plugin must not change one the /// plugin has been attached to a repository. /// </para> /// </remarks> - public virtual string Name - { + public virtual string Name + { get { return m_name; } set { m_name = value; } } @@ -98,7 +98,7 @@ namespace log4net.Plugin /// </summary> /// <remarks> /// <para> - /// This method is called to notify the plugin that + /// This method is called to notify the plugin that /// it should stop operating and should detach from /// the repository. /// </para> @@ -119,11 +119,11 @@ namespace log4net.Plugin /// </value> /// <remarks> /// <para> - /// Gets or sets the <see cref="ILoggerRepository" /> that this plugin is + /// Gets or sets the <see cref="ILoggerRepository" /> that this plugin is /// attached to. /// </para> /// </remarks> - protected virtual ILoggerRepository LoggerRepository + protected virtual ILoggerRepository LoggerRepository { get { return this.m_repository; } set { this.m_repository = value; } http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Plugin/RemoteLoggingServerPlugin.cs ---------------------------------------------------------------------- diff --git a/src/Plugin/RemoteLoggingServerPlugin.cs b/src/Plugin/RemoteLoggingServerPlugin.cs index dfe24e2..86a984a 100644 --- a/src/Plugin/RemoteLoggingServerPlugin.cs +++ b/src/Plugin/RemoteLoggingServerPlugin.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -35,7 +35,7 @@ namespace log4net.Plugin /// </summary> /// <remarks> /// <para> - /// This plugin publishes an instance of <see cref="IRemoteLoggingSink"/> + /// This plugin publishes an instance of <see cref="IRemoteLoggingSink"/> /// on a specified <see cref="SinkUri"/>. This listens for logging events delivered from /// a remote <see cref="log4net.Appender.RemotingAppender"/>. /// </para> @@ -68,7 +68,7 @@ namespace log4net.Plugin /// <summary> /// Construct with sink Uri. /// </summary> - /// <param name="sinkUri">The name to publish the sink under in the remoting infrastructure. + /// <param name="sinkUri">The name to publish the sink under in the remoting infrastructure. /// See <see cref="SinkUri"/> for more details.</param> /// <remarks> /// <para> @@ -97,8 +97,8 @@ namespace log4net.Plugin /// <see cref="M:RemotingServices.Marshal(MarshalByRefObject,String,Type)"/> /// </para> /// </remarks> - public virtual string SinkUri - { + public virtual string SinkUri + { get { return m_sinkUri; } set { m_sinkUri = value; } } @@ -127,11 +127,11 @@ namespace log4net.Plugin base.Attach(repository); // Create the sink and marshal it - m_sink = new RemoteLoggingSinkImpl(repository); + m_sink = new RemoteLoggingSinkImpl(repository); try { - RemotingServices.Marshal(m_sink, m_sinkUri, typeof(IRemoteLoggingSink)); + RemotingServices.Marshal(m_sink, m_sinkUri, typeof(IRemoteLoggingSink)); } catch(Exception ex) { @@ -242,13 +242,13 @@ namespace log4net.Plugin #region Override implementation of MarshalByRefObject /// <summary> - /// Obtains a lifetime service object to control the lifetime + /// Obtains a lifetime service object to control the lifetime /// policy for this instance. /// </summary> /// <returns><c>null</c> to indicate that this instance should live forever.</returns> /// <remarks> /// <para> - /// Obtains a lifetime service object to control the lifetime + /// Obtains a lifetime service object to control the lifetime /// policy for this instance. This object should live forever /// therefore this implementation returns <c>null</c>. /// </para> http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/ConfigurationChangedEventArgs.cs ---------------------------------------------------------------------- diff --git a/src/Repository/ConfigurationChangedEventArgs.cs b/src/Repository/ConfigurationChangedEventArgs.cs index 77df7d4..da4ccf3 100644 --- a/src/Repository/ConfigurationChangedEventArgs.cs +++ b/src/Repository/ConfigurationChangedEventArgs.cs @@ -25,14 +25,14 @@ using System.Collections; namespace log4net.Repository { /// <summary> - /// + /// /// </summary> public class ConfigurationChangedEventArgs : EventArgs { private readonly ICollection configurationMessages; /// <summary> - /// + /// /// </summary> /// <param name="configurationMessages"></param> public ConfigurationChangedEventArgs(ICollection configurationMessages) @@ -41,7 +41,7 @@ namespace log4net.Repository } /// <summary> - /// + /// /// </summary> public ICollection ConfigurationMessages { http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/Hierarchy/DefaultLoggerFactory.cs ---------------------------------------------------------------------- diff --git a/src/Repository/Hierarchy/DefaultLoggerFactory.cs b/src/Repository/Hierarchy/DefaultLoggerFactory.cs index 78239c5..5650e9a 100644 --- a/src/Repository/Hierarchy/DefaultLoggerFactory.cs +++ b/src/Repository/Hierarchy/DefaultLoggerFactory.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -42,7 +42,7 @@ namespace log4net.Repository.Hierarchy /// </summary> /// <remarks> /// <para> - /// Initializes a new instance of the <see cref="DefaultLoggerFactory" /> class. + /// Initializes a new instance of the <see cref="DefaultLoggerFactory" /> class. /// </para> /// </remarks> internal DefaultLoggerFactory() @@ -61,7 +61,7 @@ namespace log4net.Repository.Hierarchy /// <returns>The <see cref="Logger" /> instance for the specified name.</returns> /// <remarks> /// <para> - /// Create a new <see cref="Logger" /> instance with the + /// Create a new <see cref="Logger" /> instance with the /// specified name. /// </para> /// <para> @@ -73,7 +73,7 @@ namespace log4net.Repository.Hierarchy /// must be returned. /// </para> /// </remarks> - public Logger CreateLogger(ILoggerRepository repository, string name) + public Logger CreateLogger(ILoggerRepository repository, string name) { if (name == null) { @@ -103,7 +103,7 @@ namespace log4net.Repository.Hierarchy /// <remarks> /// <para> /// Initializes a new instance of the <see cref="LoggerImpl" /> class - /// with the specified name. + /// with the specified name. /// </para> /// </remarks> internal LoggerImpl(string name) : base(name) http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/Hierarchy/Hierarchy.cs ---------------------------------------------------------------------- diff --git a/src/Repository/Hierarchy/Hierarchy.cs b/src/Repository/Hierarchy/Hierarchy.cs index 0f4138f..73d98d7 100644 --- a/src/Repository/Hierarchy/Hierarchy.cs +++ b/src/Repository/Hierarchy/Hierarchy.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -62,7 +62,7 @@ namespace log4net.Repository.Hierarchy /// <param name="log">The <see cref="Logger"/> that has been created.</param> /// <remarks> /// <para> - /// Initializes a new instance of the <see cref="LoggerCreationEventArgs" /> event argument + /// Initializes a new instance of the <see cref="LoggerCreationEventArgs" /> event argument /// class,with the specified <see cref="Logger"/>. /// </para> /// </remarks> @@ -100,7 +100,7 @@ namespace log4net.Repository.Hierarchy /// </para> /// <para> /// This class is specialized in retrieving loggers by name and - /// also maintaining the logger hierarchy. Implements the + /// also maintaining the logger hierarchy. Implements the /// <see cref="ILoggerRepository"/> interface. /// </para> /// <para> @@ -172,7 +172,7 @@ namespace log4net.Repository.Hierarchy /// <param name="loggerFactory">The factory to use to create new logger instances.</param> /// <remarks> /// <para> - /// Initializes a new instance of the <see cref="Hierarchy" /> class with + /// Initializes a new instance of the <see cref="Hierarchy" /> class with /// the specified <see cref="ILoggerFactory" />. /// </para> /// </remarks> @@ -187,7 +187,7 @@ namespace log4net.Repository.Hierarchy /// <param name="loggerFactory">The factory to use to create new logger instances.</param> /// <remarks> /// <para> - /// Initializes a new instance of the <see cref="Hierarchy" /> class with + /// Initializes a new instance of the <see cref="Hierarchy" /> class with /// the specified <see cref="ILoggerFactory" />. /// </para> /// </remarks> @@ -232,8 +232,8 @@ namespace log4net.Repository.Hierarchy /// </remarks> public Logger Root { - get - { + get + { if (m_root == null) { lock(this) @@ -249,7 +249,7 @@ namespace log4net.Repository.Hierarchy } } } - return m_root; + return m_root; } } @@ -290,14 +290,14 @@ namespace log4net.Repository.Hierarchy /// its reference, otherwise returns <c>null</c>. /// </para> /// </remarks> - override public ILogger Exists(string name) - { + override public ILogger Exists(string name) + { if (name == null) { throw new ArgumentNullException("name"); } - lock(m_ht) + lock(m_ht) { return m_ht[new LoggerKey(name)] as Logger; } @@ -314,19 +314,19 @@ namespace log4net.Repository.Hierarchy /// enumeration. /// </para> /// </remarks> - override public ILogger[] GetCurrentLoggers() + override public ILogger[] GetCurrentLoggers() { // The accumulation in loggers is necessary because not all elements in // ht are Logger objects as there might be some ProvisionNodes // as well. - lock(m_ht) + lock(m_ht) { System.Collections.ArrayList loggers = new System.Collections.ArrayList(m_ht.Count); - + // Iterate through m_ht values foreach(object node in m_ht.Values) { - if (node is Logger) + if (node is Logger) { loggers.Add(node); } @@ -352,7 +352,7 @@ namespace log4net.Repository.Hierarchy /// </remarks> /// <param name="name">The name of the logger to retrieve</param> /// <returns>The logger object with the name specified</returns> - override public ILogger GetLogger(string name) + override public ILogger GetLogger(string name) { if (name == null) { @@ -383,14 +383,14 @@ namespace log4net.Repository.Hierarchy /// and again to a nested appender. /// </para> /// </remarks> - override public void Shutdown() + override public void Shutdown() { LogLog.Debug(declaringType, "Shutdown called on Hierarchy ["+this.Name+"]"); // begin by closing nested appenders Root.CloseNestedAppenders(); - lock(m_ht) + lock(m_ht) { ILogger[] currentLoggers = this.GetCurrentLoggers(); @@ -431,16 +431,16 @@ namespace log4net.Repository.Hierarchy /// block all logging until it is completed. /// </para> /// </remarks> - override public void ResetConfiguration() + override public void ResetConfiguration() { Root.Level = LevelMap.LookupWithDefault(Level.Debug); Threshold = LevelMap.LookupWithDefault(Level.All); - + // the synchronization is needed to prevent hashtable surprises - lock(m_ht) - { - Shutdown(); // nested locks are OK - + lock(m_ht) + { + Shutdown(); // nested locks are OK + foreach(Logger l in this.GetCurrentLoggers()) { l.Level = null; @@ -461,7 +461,7 @@ namespace log4net.Repository.Hierarchy /// <remarks> /// <para> /// This method should not normally be used to log. - /// The <see cref="ILog"/> interface should be used + /// The <see cref="ILog"/> interface should be used /// for routine logging. This interface can be obtained /// using the <see cref="M:log4net.LogManager.GetLogger(string)"/> method. /// </para> @@ -573,7 +573,7 @@ namespace log4net.Repository.Hierarchy /// <param name="appenders">the appenders to use to log all logging events</param> /// <remarks> /// <para> - /// This method provides the same functionality as the + /// This method provides the same functionality as the /// <see cref="M:IBasicRepositoryConfigurator.Configure(IAppender)"/> method implemented /// on this object, but it is protected and therefore can be called by subclasses. /// </para> @@ -617,7 +617,7 @@ namespace log4net.Repository.Hierarchy /// <param name="element">the element containing the root of the config</param> /// <remarks> /// <para> - /// This method provides the same functionality as the + /// This method provides the same functionality as the /// <see cref="M:IBasicRepositoryConfigurator.Configure(IAppender)"/> method implemented /// on this object, but it is protected and therefore can be called by subclasses. /// </para> @@ -665,7 +665,7 @@ namespace log4net.Repository.Hierarchy /// See also the <see cref="ILoggerRepository.Threshold"/> property. /// </para> /// </remarks> - public bool IsDisabled(Level level) + public bool IsDisabled(Level level) { // Cast level to object for performance if ((object)level == null) @@ -698,9 +698,9 @@ namespace log4net.Repository.Hierarchy /// invoking this method. /// </para> /// </remarks> - public void Clear() + public void Clear() { - lock(m_ht) + lock(m_ht) { m_ht.Clear(); } @@ -721,7 +721,7 @@ namespace log4net.Repository.Hierarchy /// ancestors as well as children. /// </para> /// </remarks> - public Logger GetLogger(string name, ILoggerFactory factory) + public Logger GetLogger(string name, ILoggerFactory factory) { if (name == null) { @@ -732,41 +732,41 @@ namespace log4net.Repository.Hierarchy throw new ArgumentNullException("factory"); } - LoggerKey key = new LoggerKey(name); - + LoggerKey key = new LoggerKey(name); + // Synchronize to prevent write conflicts. Read conflicts (in // GetEffectiveLevel() method) are possible only if variable // assignments are non-atomic. - lock(m_ht) + lock(m_ht) { Logger logger = null; Object node = m_ht[key]; - if (node == null) + if (node == null) { logger = factory.CreateLogger(this, name); logger.Hierarchy = this; - m_ht[key] = logger; + m_ht[key] = logger; UpdateParents(logger); OnLoggerCreationEvent(logger); return logger; - } - + } + Logger nodeLogger = node as Logger; - if (nodeLogger != null) + if (nodeLogger != null) { return nodeLogger; - } - + } + ProvisionNode nodeProvisionNode = node as ProvisionNode; - if (nodeProvisionNode != null) + if (nodeProvisionNode != null) { logger = factory.CreateLogger(this, name); - logger.Hierarchy = this; + logger.Hierarchy = this; m_ht[key] = logger; UpdateChildren(nodeProvisionNode, logger); - UpdateParents(logger); + UpdateParents(logger); OnLoggerCreationEvent(logger); return logger; } @@ -787,7 +787,7 @@ namespace log4net.Repository.Hierarchy /// <remarks> /// Raises the logger creation event. /// </remarks> - protected virtual void OnLoggerCreationEvent(Logger logger) + protected virtual void OnLoggerCreationEvent(Logger logger) { LoggerCreationEventHandler handler = m_loggerCreatedEvent; if (handler != null) @@ -813,47 +813,47 @@ namespace log4net.Repository.Hierarchy /// <item> /// <term>No entry for the potential parent of <paramref name="log"/> exists</term> /// <description> - /// We create a ProvisionNode for this potential + /// We create a ProvisionNode for this potential /// parent and insert <paramref name="log"/> in that provision node. /// </description> /// </item> /// <item> /// <term>The entry is of type Logger for the potential parent.</term> /// <description> - /// The entry is <paramref name="log"/>'s nearest existing parent. We - /// update <paramref name="log"/>'s parent field with this entry. We also break from - /// he loop because updating our parent's parent is our parent's + /// The entry is <paramref name="log"/>'s nearest existing parent. We + /// update <paramref name="log"/>'s parent field with this entry. We also break from + /// he loop because updating our parent's parent is our parent's /// responsibility. /// </description> /// </item> /// <item> /// <term>The entry is of type ProvisionNode for this potential parent.</term> /// <description> - /// We add <paramref name="log"/> to the list of children for this + /// We add <paramref name="log"/> to the list of children for this /// potential parent. /// </description> /// </item> /// </list> /// </remarks> - private void UpdateParents(Logger log) + private void UpdateParents(Logger log) { string name = log.Name; int length = name.Length; bool parentFound = false; - - // if name = "w.x.y.z", loop through "w.x.y", "w.x" and "w", but not "w.x.y.z" - for(int i = name.LastIndexOf('.', length-1); i >= 0; i = name.LastIndexOf('.', i-1)) + + // if name = "w.x.y.z", loop through "w.x.y", "w.x" and "w", but not "w.x.y.z" + for(int i = name.LastIndexOf('.', length-1); i >= 0; i = name.LastIndexOf('.', i-1)) { string substr = name.Substring(0, i); LoggerKey key = new LoggerKey(substr); // simple constructor Object node = m_ht[key]; // Create a provision node for a future parent. - if (node == null) + if (node == null) { ProvisionNode pn = new ProvisionNode(log); m_ht[key] = pn; - } + } else { Logger nodeLogger = node as Logger; @@ -874,7 +874,7 @@ namespace log4net.Repository.Hierarchy { LogLog.Error(declaringType, "Unexpected object type ["+node.GetType()+"] in ht.", new LogException()); } - } + } } if (i == 0) { // logger name starts with a dot @@ -884,7 +884,7 @@ namespace log4net.Repository.Hierarchy } // If we could not find any existing parents, then link with root. - if (!parentFound) + if (!parentFound) { log.Parent = this.Root; } @@ -914,18 +914,18 @@ namespace log4net.Repository.Hierarchy /// c's parent field to log. /// </para> /// </remarks> - private static void UpdateChildren(ProvisionNode pn, Logger log) + private static void UpdateChildren(ProvisionNode pn, Logger log) { - for(int i = 0; i < pn.Count; i++) + for(int i = 0; i < pn.Count; i++) { Logger childLogger = (Logger)pn[i]; // Unless this child already points to a correct (lower) parent, // make log.Parent point to childLogger.Parent and childLogger.Parent to log. - if (!childLogger.Parent.Name.StartsWith(log.Name)) + if (!childLogger.Parent.Name.StartsWith(log.Name)) { log.Parent = childLogger.Parent; - childLogger.Parent = log; + childLogger.Parent = log; } } } @@ -1063,7 +1063,7 @@ namespace log4net.Repository.Hierarchy private System.Collections.Hashtable m_ht; private Logger m_root; - + private bool m_emittedNoAppenderWarning = false; private event LoggerCreationEventHandler m_loggerCreatedEvent; http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/Hierarchy/ILoggerFactory.cs ---------------------------------------------------------------------- diff --git a/src/Repository/Hierarchy/ILoggerFactory.cs b/src/Repository/Hierarchy/ILoggerFactory.cs index 52966f4..0bdda14 100644 --- a/src/Repository/Hierarchy/ILoggerFactory.cs +++ b/src/Repository/Hierarchy/ILoggerFactory.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -24,7 +24,7 @@ namespace log4net.Repository.Hierarchy /// </summary> /// <remarks> /// <para> - /// This interface is used by the <see cref="Hierarchy"/> to + /// This interface is used by the <see cref="Hierarchy"/> to /// create new <see cref="Logger"/> objects. /// </para> /// <para> @@ -47,7 +47,7 @@ namespace log4net.Repository.Hierarchy /// <returns>The <see cref="Logger" /> instance for the specified name.</returns> /// <remarks> /// <para> - /// Create a new <see cref="Logger" /> instance with the + /// Create a new <see cref="Logger" /> instance with the /// specified name. /// </para> /// <para> http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/Hierarchy/Logger.cs ---------------------------------------------------------------------- diff --git a/src/Repository/Hierarchy/Logger.cs b/src/Repository/Hierarchy/Logger.cs index 34735a7..e675335 100644 --- a/src/Repository/Hierarchy/Logger.cs +++ b/src/Repository/Hierarchy/Logger.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -66,12 +66,12 @@ namespace log4net.Repository.Hierarchy /// a subclass that is not abstract. /// </para> /// <para> - /// Loggers are constructed by <see cref="ILoggerFactory"/> + /// Loggers are constructed by <see cref="ILoggerFactory"/> /// objects. See <see cref="DefaultLoggerFactory"/> for the default /// logger creator. /// </para> /// </remarks> - protected Logger(string name) + protected Logger(string name) { #if NETCF || NETSTANDARD1_3 // NETCF: String.Intern causes Native Exception @@ -141,14 +141,14 @@ namespace log4net.Repository.Hierarchy /// </remarks> virtual public Level EffectiveLevel { - get + get { - for(Logger c = this; c != null; c = c.m_parent) + for(Logger c = this; c != null; c = c.m_parent) { Level level = c.m_level; // Casting level to Object for performance, otherwise the overloaded operator is called - if ((object)level != null) + if ((object)level != null) { return level; } @@ -158,7 +158,7 @@ namespace log4net.Repository.Hierarchy } /// <summary> - /// Gets or sets the <see cref="Hierarchy"/> where this + /// Gets or sets the <see cref="Hierarchy"/> where this /// <c>Logger</c> instance is attached to. /// </summary> /// <value>The hierarchy that this logger belongs to.</value> @@ -174,7 +174,7 @@ namespace log4net.Repository.Hierarchy } /// <summary> - /// Gets or sets the assigned <see cref="Level"/>, if any, for this Logger. + /// Gets or sets the assigned <see cref="Level"/>, if any, for this Logger. /// </summary> /// <value> /// The <see cref="Level"/> of this logger. @@ -209,7 +209,7 @@ namespace log4net.Repository.Hierarchy /// appenders, then it won't be added again. /// </para> /// </remarks> - virtual public void AddAppender(IAppender newAppender) + virtual public void AddAppender(IAppender newAppender) { if (newAppender == null) { @@ -219,7 +219,7 @@ namespace log4net.Repository.Hierarchy m_appenderLock.AcquireWriterLock(); try { - if (m_appenderAttachedImpl == null) + if (m_appenderAttachedImpl == null) { m_appenderAttachedImpl = new log4net.Util.AppenderAttachedImpl(); } @@ -232,18 +232,18 @@ namespace log4net.Repository.Hierarchy } /// <summary> - /// Get the appenders contained in this logger as an + /// Get the appenders contained in this logger as an /// <see cref="System.Collections.ICollection"/>. /// </summary> /// <returns>A collection of the appenders in this logger</returns> /// <remarks> /// <para> - /// Get the appenders contained in this logger as an - /// <see cref="System.Collections.ICollection"/>. If no appenders + /// Get the appenders contained in this logger as an + /// <see cref="System.Collections.ICollection"/>. If no appenders /// can be found, then a <see cref="EmptyCollection"/> is returned. /// </para> /// </remarks> - virtual public AppenderCollection Appenders + virtual public AppenderCollection Appenders { get { @@ -254,7 +254,7 @@ namespace log4net.Repository.Hierarchy { return AppenderCollection.EmptyCollection; } - else + else { return m_appenderAttachedImpl.Appenders; } @@ -276,7 +276,7 @@ namespace log4net.Repository.Hierarchy /// Returns the named appender, or null if the appender is not found. /// </para> /// </remarks> - virtual public IAppender GetAppender(string name) + virtual public IAppender GetAppender(string name) { m_appenderLock.AcquireReaderLock(); try @@ -305,12 +305,12 @@ namespace log4net.Repository.Hierarchy /// This is useful when re-reading configuration information. /// </para> /// </remarks> - virtual public void RemoveAllAppenders() + virtual public void RemoveAllAppenders() { m_appenderLock.AcquireWriterLock(); try { - if (m_appenderAttachedImpl != null) + if (m_appenderAttachedImpl != null) { m_appenderAttachedImpl.RemoveAllAppenders(); m_appenderAttachedImpl = null; @@ -335,12 +335,12 @@ namespace log4net.Repository.Hierarchy /// <see cref="IAppender.Close"/> on the appender removed. /// </para> /// </remarks> - virtual public IAppender RemoveAppender(IAppender appender) + virtual public IAppender RemoveAppender(IAppender appender) { m_appenderLock.AcquireWriterLock(); try { - if (appender != null && m_appenderAttachedImpl != null) + if (appender != null && m_appenderAttachedImpl != null) { return m_appenderAttachedImpl.RemoveAppender(appender); } @@ -365,7 +365,7 @@ namespace log4net.Repository.Hierarchy /// <see cref="IAppender.Close"/> on the appender removed. /// </para> /// </remarks> - virtual public IAppender RemoveAppender(string name) + virtual public IAppender RemoveAppender(string name) { m_appenderLock.AcquireWriterLock(); try @@ -381,7 +381,7 @@ namespace log4net.Repository.Hierarchy } return null; } - + #endregion #region Implementation of ILogger @@ -419,7 +419,7 @@ namespace log4net.Repository.Hierarchy /// This method must not throw any exception to the caller. /// </para> /// </remarks> - virtual public void Log(Type callerStackBoundaryDeclaringType, Level level, object message, Exception exception) + virtual public void Log(Type callerStackBoundaryDeclaringType, Level level, object message, Exception exception) { try { @@ -441,7 +441,7 @@ namespace log4net.Repository.Hierarchy } /// <summary> - /// This is the most generic printing method that is intended to be used + /// This is the most generic printing method that is intended to be used /// by wrappers. /// </summary> /// <param name="logEvent">The event being logged.</param> @@ -519,7 +519,7 @@ namespace log4net.Repository.Hierarchy } /// <summary> - /// Gets the <see cref="ILoggerRepository"/> where this + /// Gets the <see cref="ILoggerRepository"/> where this /// <c>Logger</c> instance is attached to. /// </summary> /// <value> @@ -527,12 +527,12 @@ namespace log4net.Repository.Hierarchy /// </value> /// <remarks> /// <para> - /// Gets the <see cref="ILoggerRepository"/> where this + /// Gets the <see cref="ILoggerRepository"/> where this /// <c>Logger</c> instance is attached to. /// </para> /// </remarks> public ILoggerRepository Repository - { + { get { return m_hierarchy; } } @@ -554,7 +554,7 @@ namespace log4net.Repository.Hierarchy /// to log the particular log request. /// </para> /// </remarks> - virtual protected void CallAppenders(LoggingEvent loggingEvent) + virtual protected void CallAppenders(LoggingEvent loggingEvent) { if (loggingEvent == null) { @@ -563,15 +563,15 @@ namespace log4net.Repository.Hierarchy int writes = 0; - for(Logger c=this; c != null; c=c.m_parent) + for(Logger c=this; c != null; c=c.m_parent) { - if (c.m_appenderAttachedImpl != null) + if (c.m_appenderAttachedImpl != null) { // Protected against simultaneous call to addAppender, removeAppender,... c.m_appenderLock.AcquireReaderLock(); try { - if (c.m_appenderAttachedImpl != null) + if (c.m_appenderAttachedImpl != null) { writes += c.m_appenderAttachedImpl.AppendLoopOnAppenders(loggingEvent); } @@ -582,12 +582,12 @@ namespace log4net.Repository.Hierarchy } } - if (!c.m_additive) + if (!c.m_additive) { break; } } - + // No appenders in hierarchy, warn user only once. // // Note that by including the AppDomain values for the currently running @@ -597,7 +597,7 @@ namespace log4net.Repository.Hierarchy // or impossible to determine which .config file is missing appender // definitions. // - if (!m_hierarchy.EmittedNoAppenderWarning && writes == 0) + if (!m_hierarchy.EmittedNoAppenderWarning && writes == 0) { m_hierarchy.EmittedNoAppenderWarning = true; LogLog.Debug(declaringType, "No appenders could be found for logger [" + Name + "] repository [" + Repository.Name + "]"); @@ -626,7 +626,7 @@ namespace log4net.Repository.Hierarchy /// Used to ensure that the appenders are correctly shutdown. /// </para> /// </remarks> - virtual public void CloseNestedAppenders() + virtual public void CloseNestedAppenders() { m_appenderLock.AcquireWriterLock(); try @@ -661,7 +661,7 @@ namespace log4net.Repository.Hierarchy /// the <paramref name="message"/>. /// </para> /// </remarks> - virtual public void Log(Level level, object message, Exception exception) + virtual public void Log(Level level, object message, Exception exception) { if (IsEnabledFor(level)) { @@ -683,7 +683,7 @@ namespace log4net.Repository.Hierarchy /// appenders. /// </para> /// </remarks> - virtual protected void ForcedLog(Type callerStackBoundaryDeclaringType, Level level, object message, Exception exception) + virtual protected void ForcedLog(Type callerStackBoundaryDeclaringType, Level level, object message, Exception exception) { CallAppenders(new LoggingEvent(callerStackBoundaryDeclaringType, this.Hierarchy, this.Name, level, message, exception)); } @@ -697,7 +697,7 @@ namespace log4net.Repository.Hierarchy /// Delivers the logging event to the attached appenders. /// </para> /// </remarks> - virtual protected void ForcedLog(LoggingEvent logEvent) + virtual protected void ForcedLog(LoggingEvent logEvent) { // The logging event may not have been created by this logger // the Repository may not be correctly set on the event. This @@ -721,15 +721,15 @@ namespace log4net.Repository.Hierarchy /// <summary> /// The name of this logger. /// </summary> - private readonly string m_name; + private readonly string m_name; /// <summary> - /// The assigned level of this logger. + /// The assigned level of this logger. /// </summary> /// <remarks> /// <para> - /// The <c>level</c> variable need not be - /// assigned a value in which case it is inherited + /// The <c>level</c> variable need not be + /// assigned a value in which case it is inherited /// form the hierarchy. /// </para> /// </remarks> @@ -740,7 +740,7 @@ namespace log4net.Repository.Hierarchy /// </summary> /// <remarks> /// <para> - /// The parent of this logger. + /// The parent of this logger. /// All loggers have at least one ancestor which is the root logger. /// </para> /// </remarks> @@ -783,7 +783,7 @@ namespace log4net.Repository.Hierarchy /// Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl /// </summary> private readonly ReaderWriterLock m_appenderLock = new ReaderWriterLock(); - + #endregion } } http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/Hierarchy/LoggerKey.cs ---------------------------------------------------------------------- diff --git a/src/Repository/Hierarchy/LoggerKey.cs b/src/Repository/Hierarchy/LoggerKey.cs index ccc566b..7b69766 100644 --- a/src/Repository/Hierarchy/LoggerKey.cs +++ b/src/Repository/Hierarchy/LoggerKey.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -26,13 +26,13 @@ namespace log4net.Repository.Hierarchy /// </summary> /// <remarks> /// <para> - /// Internal class used to improve performance of + /// Internal class used to improve performance of /// string keyed hashtables. /// </para> /// <para> /// The hashcode of the string is cached for reuse. /// The string is stored as an interned value. - /// When comparing two <see cref="LoggerKey"/> objects for equality + /// When comparing two <see cref="LoggerKey"/> objects for equality /// the reference equality of the interned strings is compared. /// </para> /// </remarks> @@ -47,7 +47,7 @@ namespace log4net.Repository.Hierarchy /// </summary> /// <remarks> /// <para> - /// Initializes a new instance of the <see cref="LoggerKey" /> class + /// Initializes a new instance of the <see cref="LoggerKey" /> class /// with the specified name. /// </para> /// <para> @@ -62,7 +62,7 @@ namespace log4net.Repository.Hierarchy /// </note> /// </remarks> /// <param name="name">The name of the logger.</param> - internal LoggerKey(string name) + internal LoggerKey(string name) { #if NETCF || NETSTANDARD1_3 // NETCF: String.Intern causes Native Exception @@ -86,13 +86,13 @@ namespace log4net.Repository.Hierarchy /// Returns the cached hashcode. /// </para> /// </remarks> - override public int GetHashCode() + override public int GetHashCode() { return m_hashCache; } /// <summary> - /// Determines whether two <see cref="LoggerKey" /> instances + /// Determines whether two <see cref="LoggerKey" /> instances /// are equal. /// </summary> /// <param name="obj">The <see cref="object" /> to compare with the current <see cref="LoggerKey" />.</param> @@ -104,16 +104,16 @@ namespace log4net.Repository.Hierarchy /// Compares the references of the interned strings. /// </para> /// </remarks> - override public bool Equals(object obj) + override public bool Equals(object obj) { // Compare reference type of this against argument if (((object)this) == obj) { return true; } - + LoggerKey objKey = obj as LoggerKey; - if (objKey != null) + if (objKey != null) { #if NETCF || NETSTANDARD1_3 return ( m_name == objKey.m_name ); @@ -129,10 +129,10 @@ namespace log4net.Repository.Hierarchy #region Private Instance Fields - private readonly string m_name; + private readonly string m_name; private readonly int m_hashCache; #endregion Private Instance Fields - } + } } http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/Hierarchy/ProvisionNode.cs ---------------------------------------------------------------------- diff --git a/src/Repository/Hierarchy/ProvisionNode.cs b/src/Repository/Hierarchy/ProvisionNode.cs index 50f4e16..e30bba3 100644 --- a/src/Repository/Hierarchy/ProvisionNode.cs +++ b/src/Repository/Hierarchy/ProvisionNode.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -27,8 +27,8 @@ namespace log4net.Repository.Hierarchy /// </summary> /// <remarks> /// <para> - /// <see cref="ProvisionNode"/> instances are used in the - /// <see cref="Hierarchy" /> when there is no specified + /// <see cref="ProvisionNode"/> instances are used in the + /// <see cref="Hierarchy" /> when there is no specified /// <see cref="Logger" /> for that node. /// </para> /// <para> @@ -46,7 +46,7 @@ namespace log4net.Repository.Hierarchy /// <param name="log">A child logger to add to this node.</param> /// <remarks> /// <para> - /// Initializes a new instance of the <see cref="ProvisionNode" /> class + /// Initializes a new instance of the <see cref="ProvisionNode" /> class /// with the specified child logger. /// </para> /// </remarks> http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/Hierarchy/RootLogger.cs ---------------------------------------------------------------------- diff --git a/src/Repository/Hierarchy/RootLogger.cs b/src/Repository/Hierarchy/RootLogger.cs index e178bb7..1e818a2 100644 --- a/src/Repository/Hierarchy/RootLogger.cs +++ b/src/Repository/Hierarchy/RootLogger.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -25,11 +25,11 @@ using log4net.Core; namespace log4net.Repository.Hierarchy { /// <summary> - /// The <see cref="RootLogger" /> sits at the root of the logger hierarchy tree. + /// The <see cref="RootLogger" /> sits at the root of the logger hierarchy tree. /// </summary> /// <remarks> /// <para> - /// The <see cref="RootLogger" /> is a regular <see cref="Logger" /> except + /// The <see cref="RootLogger" /> is a regular <see cref="Logger" /> except /// that it provides several guarantees. /// </para> /// <para> @@ -79,16 +79,16 @@ namespace log4net.Repository.Hierarchy /// value of <see cref="Logger.Level"/>. /// </para> /// </remarks> - override public Level EffectiveLevel + override public Level EffectiveLevel { - get + get { return base.Level; } } /// <summary> - /// Gets or sets the assigned <see cref="Level"/> for the root logger. + /// Gets or sets the assigned <see cref="Level"/> for the root logger. /// </summary> /// <value> /// The <see cref="Level"/> of the root logger. @@ -104,11 +104,11 @@ namespace log4net.Repository.Hierarchy get { return base.Level; } set { - if (value == null) + if (value == null) { LogLog.Error(declaringType, "You have tried to set a null level to root.", new LogException()); } - else + else { base.Level = value; } http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/Hierarchy/XmlHierarchyConfigurator.cs ---------------------------------------------------------------------- diff --git a/src/Repository/Hierarchy/XmlHierarchyConfigurator.cs b/src/Repository/Hierarchy/XmlHierarchyConfigurator.cs index f5021c1..5c7a96a 100644 --- a/src/Repository/Hierarchy/XmlHierarchyConfigurator.cs +++ b/src/Repository/Hierarchy/XmlHierarchyConfigurator.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -44,7 +44,7 @@ namespace log4net.Repository.Hierarchy { private enum ConfigUpdateMode { - Merge, + Merge, Overwrite } @@ -60,7 +60,7 @@ namespace log4net.Repository.Hierarchy /// with the specified <see cref="Hierarchy" />. /// </para> /// </remarks> - public XmlHierarchyConfigurator(Hierarchy hierarchy) + public XmlHierarchyConfigurator(Hierarchy hierarchy) { m_hierarchy = hierarchy; m_appenderBag = new Hashtable(); @@ -79,7 +79,7 @@ namespace log4net.Repository.Hierarchy /// Configure the hierarchy by parsing a DOM tree of XML elements. /// </para> /// </remarks> - public void Configure(XmlElement element) + public void Configure(XmlElement element) { if (element == null || m_hierarchy == null) { @@ -116,18 +116,18 @@ namespace log4net.Repository.Hierarchy string debugAttribute = element.GetAttribute(INTERNAL_DEBUG_ATTR); LogLog.Debug(declaringType, INTERNAL_DEBUG_ATTR+" attribute [" + debugAttribute + "]."); - if (debugAttribute.Length>0 && debugAttribute != "null") - { + if (debugAttribute.Length>0 && debugAttribute != "null") + { LogLog.InternalDebugging = OptionConverter.ToBoolean(debugAttribute, true); } - else + else { LogLog.Debug(declaringType, "Ignoring " + INTERNAL_DEBUG_ATTR + " attribute."); } string confDebug = element.GetAttribute(CONFIG_DEBUG_ATTR); if (confDebug.Length>0 && confDebug != "null") - { + { LogLog.Warn(declaringType, "The \"" + CONFIG_DEBUG_ATTR + "\" attribute is deprecated."); LogLog.Warn(declaringType, "Use the \"" + INTERNAL_DEBUG_ATTR + "\" attribute instead."); LogLog.InternalDebugging = OptionConverter.ToBoolean(confDebug, true); @@ -170,23 +170,23 @@ namespace log4net.Repository.Hierarchy foreach (XmlNode currentNode in element.ChildNodes) { - if (currentNode.NodeType == XmlNodeType.Element) + if (currentNode.NodeType == XmlNodeType.Element) { XmlElement currentElement = (XmlElement)currentNode; if (currentElement.LocalName == LOGGER_TAG) { ParseLogger(currentElement); - } + } else if (currentElement.LocalName == CATEGORY_TAG) { // TODO: deprecated use of category ParseLogger(currentElement); - } + } else if (currentElement.LocalName == ROOT_TAG) { ParseRoot(currentElement); - } + } else if (currentElement.LocalName == RENDERER_TAG) { ParseRenderer(currentElement); @@ -207,7 +207,7 @@ namespace log4net.Repository.Hierarchy // Lastly set the hierarchy threshold string thresholdStr = element.GetAttribute(THRESHOLD_ATTR); LogLog.Debug(declaringType, "Hierarchy Threshold [" + thresholdStr + "]"); - if (thresholdStr.Length > 0 && thresholdStr != "null") + if (thresholdStr.Length > 0 && thresholdStr != "null") { Level thresholdLevel = (Level) ConvertStringTo(typeof(Level), thresholdStr); if (thresholdLevel != null) @@ -234,20 +234,20 @@ namespace log4net.Repository.Hierarchy /// <returns>The instance of the appender that the ref refers to.</returns> /// <remarks> /// <para> - /// Parse an XML element that represents an appender and return + /// Parse an XML element that represents an appender and return /// the appender. /// </para> /// </remarks> - protected IAppender FindAppenderByReference(XmlElement appenderRef) - { + protected IAppender FindAppenderByReference(XmlElement appenderRef) + { string appenderName = appenderRef.GetAttribute(REF_ATTR); IAppender appender = (IAppender)m_appenderBag[appenderName]; - if (appender != null) + if (appender != null) { return appender; - } - else + } + else { // Find the element with that id XmlElement element = null; @@ -264,11 +264,11 @@ namespace log4net.Repository.Hierarchy } } - if (element == null) + if (element == null) { - LogLog.Error(declaringType, "XmlHierarchyConfigurator: No appender named [" + appenderName + "] could be found."); + LogLog.Error(declaringType, "XmlHierarchyConfigurator: No appender named [" + appenderName + "] could be found."); return null; - } + } else { appender = ParseAppender(element); @@ -278,7 +278,7 @@ namespace log4net.Repository.Hierarchy } return appender; } - } + } } /// <summary> @@ -292,13 +292,13 @@ namespace log4net.Repository.Hierarchy /// the appender instance. /// </para> /// </remarks> - protected IAppender ParseAppender(XmlElement appenderElement) + protected IAppender ParseAppender(XmlElement appenderElement) { string appenderName = appenderElement.GetAttribute(NAME_ATTR); string typeName = appenderElement.GetAttribute(TYPE_ATTR); LogLog.Debug(declaringType, "Loading Appender [" + appenderName + "] type: [" + typeName + "]"); - try + try { #if NETSTANDARD1_3 IAppender appender = (IAppender)Activator.CreateInstance(SystemInfo.GetTypeFromString(this.GetType().GetTypeInfo().Assembly, typeName, true, true)); @@ -310,7 +310,7 @@ namespace log4net.Repository.Hierarchy foreach (XmlNode currentNode in appenderElement.ChildNodes) { /* We're only interested in Elements */ - if (currentNode.NodeType == XmlNodeType.Element) + if (currentNode.NodeType == XmlNodeType.Element) { XmlElement currentElement = (XmlElement)currentNode; @@ -320,7 +320,7 @@ namespace log4net.Repository.Hierarchy string refName = currentElement.GetAttribute(REF_ATTR); IAppenderAttachable appenderContainer = appender as IAppenderAttachable; - if (appenderContainer != null) + if (appenderContainer != null) { LogLog.Debug(declaringType, "Attaching appender named [" + refName + "] to appender named [" + appender.Name + "]."); @@ -329,8 +329,8 @@ namespace log4net.Repository.Hierarchy { appenderContainer.AddAppender(referencedAppender); } - } - else + } + else { LogLog.Error(declaringType, "Requesting attachment of appender named ["+refName+ "] to appender named [" + appender.Name + "] which does not implement log4net.Core.IAppenderAttachable."); } @@ -344,15 +344,15 @@ namespace log4net.Repository.Hierarchy } IOptionHandler optionHandler = appender as IOptionHandler; - if (optionHandler != null) + if (optionHandler != null) { optionHandler.ActivateOptions(); } - LogLog.Debug(declaringType, "Created Appender [" + appenderName + "]"); + LogLog.Debug(declaringType, "Created Appender [" + appenderName + "]"); return appender; } - catch (Exception ex) + catch (Exception ex) { // Yes, it's ugly. But all exceptions point to the same problem: we can't create an Appender @@ -370,7 +370,7 @@ namespace log4net.Repository.Hierarchy /// Parse an XML element that represents a logger. /// </para> /// </remarks> - protected void ParseLogger(XmlElement loggerElement) + protected void ParseLogger(XmlElement loggerElement) { // Create a new log4net.Logger object from the <logger> element. string loggerName = loggerElement.GetAttribute(NAME_ATTR); @@ -381,10 +381,10 @@ namespace log4net.Repository.Hierarchy // Setting up a logger needs to be an atomic operation, in order // to protect potential log operations while logger // configuration is in progress. - lock(log) + lock(log) { bool additivity = OptionConverter.ToBoolean(loggerElement.GetAttribute(ADDITIVITY_ATTR), true); - + LogLog.Debug(declaringType, "Setting [" + log.Name + "] additivity to [" + additivity + "]."); log.Additivity = additivity; ParseChildrenOfLoggerElement(loggerElement, log, false); @@ -400,12 +400,12 @@ namespace log4net.Repository.Hierarchy /// Parse an XML element that represents the root logger. /// </para> /// </remarks> - protected void ParseRoot(XmlElement rootElement) + protected void ParseRoot(XmlElement rootElement) { Logger root = m_hierarchy.Root; // logger configuration needs to be atomic - lock(root) - { + lock(root) + { ParseChildrenOfLoggerElement(rootElement, root, true); } } @@ -421,7 +421,7 @@ namespace log4net.Repository.Hierarchy /// Parse the child elements of a <logger> element. /// </para> /// </remarks> - protected void ParseChildrenOfLoggerElement(XmlElement catElement, Logger log, bool isRoot) + protected void ParseChildrenOfLoggerElement(XmlElement catElement, Logger log, bool isRoot) { // Remove all existing appenders from log. They will be // reconstructed if need be. @@ -429,10 +429,10 @@ namespace log4net.Repository.Hierarchy foreach (XmlNode currentNode in catElement.ChildNodes) { - if (currentNode.NodeType == XmlNodeType.Element) + if (currentNode.NodeType == XmlNodeType.Element) { XmlElement currentElement = (XmlElement) currentNode; - + if (currentElement.LocalName == APPENDER_REF_TAG) { IAppender appender = FindAppenderByReference(currentElement); @@ -442,15 +442,15 @@ namespace log4net.Repository.Hierarchy LogLog.Debug(declaringType, "Adding appender named [" + refName + "] to logger [" + log.Name + "]."); log.AddAppender(appender); } - else + else { LogLog.Error(declaringType, "Appender named [" + refName + "] not found."); } - } - else if (currentElement.LocalName == LEVEL_TAG || currentElement.LocalName == PRIORITY_TAG) + } + else if (currentElement.LocalName == LEVEL_TAG || currentElement.LocalName == PRIORITY_TAG) { - ParseLevel(currentElement, log, isRoot); - } + ParseLevel(currentElement, log, isRoot); + } else { SetParameter(currentElement, log); @@ -459,7 +459,7 @@ namespace log4net.Repository.Hierarchy } IOptionHandler optionHandler = log as IOptionHandler; - if (optionHandler != null) + if (optionHandler != null) { optionHandler.ActivateOptions(); } @@ -474,29 +474,29 @@ namespace log4net.Repository.Hierarchy /// Parse an XML element that represents a renderer. /// </para> /// </remarks> - protected void ParseRenderer(XmlElement element) + protected void ParseRenderer(XmlElement element) { string renderingClassName = element.GetAttribute(RENDERING_TYPE_ATTR); string renderedClassName = element.GetAttribute(RENDERED_TYPE_ATTR); LogLog.Debug(declaringType, "Rendering class [" + renderingClassName + "], Rendered class [" + renderedClassName + "]."); IObjectRenderer renderer = (IObjectRenderer)OptionConverter.InstantiateByClassName(renderingClassName, typeof(IObjectRenderer), null); - if (renderer == null) + if (renderer == null) { LogLog.Error(declaringType, "Could not instantiate renderer [" + renderingClassName + "]."); return; - } - else + } + else { - try + try { #if NETSTANDARD1_3 m_hierarchy.RendererMap.Put(SystemInfo.GetTypeFromString(this.GetType().GetTypeInfo().Assembly, renderedClassName, true, true), renderer); #else m_hierarchy.RendererMap.Put(SystemInfo.GetTypeFromString(renderedClassName, true, true), renderer); #endif - } - catch(Exception e) + } + catch(Exception e) { LogLog.Error(declaringType, "Could not find class [" + renderedClassName + "].", e); } @@ -514,30 +514,30 @@ namespace log4net.Repository.Hierarchy /// Parse an XML element that represents a level. /// </para> /// </remarks> - protected void ParseLevel(XmlElement element, Logger log, bool isRoot) + protected void ParseLevel(XmlElement element, Logger log, bool isRoot) { string loggerName = log.Name; - if (isRoot) + if (isRoot) { loggerName = "root"; } string levelStr = element.GetAttribute(VALUE_ATTR); LogLog.Debug(declaringType, "Logger [" + loggerName + "] Level string is [" + levelStr + "]."); - - if (INHERITED == levelStr) + + if (INHERITED == levelStr) { - if (isRoot) + if (isRoot) { LogLog.Error(declaringType, "Root level cannot be inherited. Ignoring directive."); - } - else + } + else { - LogLog.Debug(declaringType, "Logger [" + loggerName + "] level set to inherit from parent."); + LogLog.Debug(declaringType, "Logger [" + loggerName + "] level set to inherit from parent."); log.Level = null; } - } - else + } + else { log.Level = log.Hierarchy.LevelMap[levelStr]; if (log.Level == null) @@ -546,7 +546,7 @@ namespace log4net.Repository.Hierarchy } else { - LogLog.Debug(declaringType, "Logger [" + loggerName + "] level set to [name=\"" + log.Level.Name + "\",value=" + log.Level.Value + "]."); + LogLog.Debug(declaringType, "Logger [" + loggerName + "] level set to [name=\"" + log.Level.Name + "\",value=" + log.Level.Value + "]."); } } } @@ -567,7 +567,7 @@ namespace log4net.Repository.Hierarchy /// string argument and return a value that can be used to /// set the property. /// </remarks> - protected void SetParameter(XmlElement element, object target) + protected void SetParameter(XmlElement element, object target) { // Get the property name string name = element.GetAttribute(NAME_ATTR); @@ -650,8 +650,8 @@ namespace log4net.Repository.Hierarchy } catch(System.Security.SecurityException) { - // This security exception will occur if the caller does not have - // unrestricted environment permission. If this occurs the expansion + // This security exception will occur if the caller does not have + // unrestricted environment permission. If this occurs the expansion // will be skipped with the following warning message. LogLog.Debug(declaringType, "Security exception while trying to expand environment variables. Error Ignored. No Expansion."); } @@ -707,7 +707,7 @@ namespace log4net.Repository.Hierarchy // to pass to this property. object convertedValue = ConvertStringTo(propertyType, propertyValue); - + // Check if we need to do an additional conversion if (convertedValue != null && parsedObjectConversionTargetType != null) { @@ -925,7 +925,7 @@ namespace log4net.Repository.Hierarchy /// <param name="value">The string value to use as the value of the object.</param> /// <returns> /// <para> - /// An object of type <paramref name="type"/> with value <paramref name="value"/> or + /// An object of type <paramref name="type"/> with value <paramref name="value"/> or /// <c>null</c> when the conversion could not be performed. /// </para> /// </returns> @@ -966,7 +966,7 @@ namespace log4net.Repository.Hierarchy /// <paramref name="typeConstraint"/> type. /// </para> /// </remarks> - protected object CreateObjectFromXml(XmlElement element, Type defaultTargetType, Type typeConstraint) + protected object CreateObjectFromXml(XmlElement element, Type defaultTargetType, Type typeConstraint) { Type objectType = null; @@ -1037,7 +1037,7 @@ namespace log4net.Repository.Hierarchy // Set any params on object foreach (XmlNode currentNode in element.ChildNodes) { - if (currentNode.NodeType == XmlNodeType.Element) + if (currentNode.NodeType == XmlNodeType.Element) { SetParameter((XmlElement)currentNode, createdObject); } @@ -1104,7 +1104,7 @@ namespace log4net.Repository.Hierarchy private const string CONFIGURATION_TAG = "log4net"; private const string RENDERER_TAG = "renderer"; private const string APPENDER_TAG = "appender"; - private const string APPENDER_REF_TAG = "appender-ref"; + private const string APPENDER_REF_TAG = "appender-ref"; private const string PARAM_TAG = "param"; // TODO: Deprecate use of category tags @@ -1119,7 +1119,7 @@ namespace log4net.Repository.Hierarchy private const string ROOT_TAG = "root"; private const string LEVEL_TAG = "level"; private const string REF_ATTR = "ref"; - private const string ADDITIVITY_ATTR = "additivity"; + private const string ADDITIVITY_ATTR = "additivity"; private const string THRESHOLD_ATTR = "threshold"; private const string CONFIG_DEBUG_ATTR = "configDebug"; private const string INTERNAL_DEBUG_ATTR = "debug"; http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/IBasicRepositoryConfigurator.cs ---------------------------------------------------------------------- diff --git a/src/Repository/IBasicRepositoryConfigurator.cs b/src/Repository/IBasicRepositoryConfigurator.cs index 7fdbb70..50d710a 100644 --- a/src/Repository/IBasicRepositoryConfigurator.cs +++ b/src/Repository/IBasicRepositoryConfigurator.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/ILoggerRepository.cs ---------------------------------------------------------------------- diff --git a/src/Repository/ILoggerRepository.cs b/src/Repository/ILoggerRepository.cs index 30ef5b3..64e923f 100644 --- a/src/Repository/ILoggerRepository.cs +++ b/src/Repository/ILoggerRepository.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -75,13 +75,13 @@ namespace log4net.Repository public delegate void LoggerRepositoryConfigurationChangedEventHandler(object sender, EventArgs e); #endregion - + /// <summary> /// Interface implemented by logger repositories. /// </summary> /// <remarks> /// <para> - /// This interface is implemented by logger repositories. e.g. + /// This interface is implemented by logger repositories. e.g. /// <see cref="Hierarchy"/>. /// </para> /// <para> @@ -252,7 +252,7 @@ namespace log4net.Repository /// <remarks> /// <para> /// This method should not normally be used to log. - /// The <see cref="ILog"/> interface should be used + /// The <see cref="ILog"/> interface should be used /// for routine logging. This interface can be obtained /// using the <see cref="M:log4net.LogManager.GetLogger(string)"/> method. /// </para> @@ -277,7 +277,7 @@ namespace log4net.Repository bool Configured { get; set; } /// <summary> - /// Collection of internal messages captured during the most + /// Collection of internal messages captured during the most /// recent configuration process. /// </summary> ICollection ConfigurationMessages { get; set; } http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/IXmlRepositoryConfigurator.cs ---------------------------------------------------------------------- diff --git a/src/Repository/IXmlRepositoryConfigurator.cs b/src/Repository/IXmlRepositoryConfigurator.cs index 6fd657c..006b10c 100644 --- a/src/Repository/IXmlRepositoryConfigurator.cs +++ b/src/Repository/IXmlRepositoryConfigurator.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Repository/LoggerRepositorySkeleton.cs ---------------------------------------------------------------------- diff --git a/src/Repository/LoggerRepositorySkeleton.cs b/src/Repository/LoggerRepositorySkeleton.cs index e4f06f8..7170354 100644 --- a/src/Repository/LoggerRepositorySkeleton.cs +++ b/src/Repository/LoggerRepositorySkeleton.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -110,7 +110,7 @@ namespace log4net.Repository /// <remarks> /// <para> /// The name of this repository. The name is - /// used to store and lookup the repositories + /// used to store and lookup the repositories /// stored by the <see cref="IRepositorySelector"/>. /// </para> /// </remarks> @@ -135,10 +135,10 @@ namespace log4net.Repository { get { return m_threshold; } set - { + { if (value != null) { - m_threshold = value; + m_threshold = value; } else { @@ -255,7 +255,7 @@ namespace log4net.Repository /// listeners and all attached plugins of the shutdown event. /// </para> /// </remarks> - virtual public void Shutdown() + virtual public void Shutdown() { // Shutdown attached plugins foreach(IPlugin plugin in PluginMap.AllPlugins) @@ -283,7 +283,7 @@ namespace log4net.Repository /// block all logging until it is completed. /// </para> /// </remarks> - virtual public void ResetConfiguration() + virtual public void ResetConfiguration() { // Clear internal data structures m_rendererMap.Clear(); @@ -306,7 +306,7 @@ namespace log4net.Repository /// <remarks> /// <para> /// This method should not normally be used to log. - /// The <see cref="ILog"/> interface should be used + /// The <see cref="ILog"/> interface should be used /// for routine logging. This interface can be obtained /// using the <see cref="M:log4net.LogManager.GetLogger(string)"/> method. /// </para> @@ -328,14 +328,14 @@ namespace log4net.Repository /// Flag indicates if this repository has been configured. /// </para> /// </remarks> - virtual public bool Configured - { + virtual public bool Configured + { get { return m_configured; } set { m_configured = value; } } /// <summary> - /// Contains a list of internal messages captures during the + /// Contains a list of internal messages captures during the /// last configuration. /// </summary> virtual public ICollection ConfigurationMessages @@ -405,9 +405,9 @@ namespace log4net.Repository /// <remarks> /// These properties can be specified on a repository specific basis /// </remarks> - public PropertiesDictionary Properties - { - get { return m_properties; } + public PropertiesDictionary Properties + { + get { return m_properties; } } /// <summary> @@ -444,17 +444,17 @@ namespace log4net.Repository // Unrecoverable errors m_levelMap.Add(Level.Emergency); m_levelMap.Add(Level.Fatal); - m_levelMap.Add(Level.Alert); + m_levelMap.Add(Level.Alert); // Recoverable errors - m_levelMap.Add(Level.Critical); - m_levelMap.Add(Level.Severe); - m_levelMap.Add(Level.Error); + m_levelMap.Add(Level.Critical); + m_levelMap.Add(Level.Severe); + m_levelMap.Add(Level.Error); m_levelMap.Add(Level.Warn); // Information - m_levelMap.Add(Level.Notice); - m_levelMap.Add(Level.Info); + m_levelMap.Add(Level.Notice); + m_levelMap.Add(Level.Info); // Debug m_levelMap.Add(Level.Debug); @@ -468,16 +468,16 @@ namespace log4net.Repository } /// <summary> - /// Adds an object renderer for a specific class. + /// Adds an object renderer for a specific class. /// </summary> /// <param name="typeToRender">The type that will be rendered by the renderer supplied.</param> /// <param name="rendererInstance">The object renderer used to render the object.</param> /// <remarks> /// <para> - /// Adds an object renderer for a specific class. + /// Adds an object renderer for a specific class. /// </para> /// </remarks> - virtual public void AddRenderer(Type typeToRender, IObjectRenderer rendererInstance) + virtual public void AddRenderer(Type typeToRender, IObjectRenderer rendererInstance) { if (typeToRender == null) { http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/ThreadContext.cs ---------------------------------------------------------------------- diff --git a/src/ThreadContext.cs b/src/ThreadContext.cs index 9d668f7..21b2e28 100644 --- a/src/ThreadContext.cs +++ b/src/ThreadContext.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -29,19 +29,19 @@ namespace log4net /// </summary> /// <remarks> /// <para> - /// The <c>ThreadContext</c> provides a location for thread specific debugging + /// The <c>ThreadContext</c> provides a location for thread specific debugging /// information to be stored. /// The <c>ThreadContext</c> properties override any <see cref="GlobalContext"/> /// properties with the same name. /// </para> /// <para> /// The thread context has a properties map and a stack. - /// The properties and stack can + /// The properties and stack can /// be included in the output of log messages. The <see cref="log4net.Layout.PatternLayout"/> /// supports selecting and outputting these properties. /// </para> /// <para> - /// The Thread Context provides a diagnostic context for the current thread. + /// The Thread Context provides a diagnostic context for the current thread. /// This is an instrument for distinguishing interleaved log /// output from different sources. Log output is typically interleaved /// when a server handles multiple clients near-simultaneously. @@ -61,8 +61,8 @@ namespace log4net /// using(ThreadContext.Stacks["NDC"].Push("my context message")) /// { /// log.Info("This log message has a ThreadContext Stack message that includes 'my context message'"); - /// - /// } // at the end of the using block the message is automatically popped + /// + /// } // at the end of the using block the message is automatically popped /// </code> /// </example> /// <threadsafety static="true" instance="true" /> @@ -72,7 +72,7 @@ namespace log4net #region Private Instance Constructors /// <summary> - /// Private Constructor. + /// Private Constructor. /// </summary> /// <remarks> /// <para> http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Util/AppenderAttachedImpl.cs ---------------------------------------------------------------------- diff --git a/src/Util/AppenderAttachedImpl.cs b/src/Util/AppenderAttachedImpl.cs index fafb0b8..6c17096 100644 --- a/src/Util/AppenderAttachedImpl.cs +++ b/src/Util/AppenderAttachedImpl.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -63,11 +63,11 @@ namespace log4net.Util /// <returns>The number of appenders called.</returns> /// <remarks> /// <para> - /// Calls the <see cref="IAppender.DoAppend" /> method on all + /// Calls the <see cref="IAppender.DoAppend" /> method on all /// attached appenders. /// </para> /// </remarks> - public int AppendLoopOnAppenders(LoggingEvent loggingEvent) + public int AppendLoopOnAppenders(LoggingEvent loggingEvent) { if (loggingEvent == null) { @@ -75,7 +75,7 @@ namespace log4net.Util } // m_appenderList is null when empty - if (m_appenderList == null) + if (m_appenderList == null) { return 0; } @@ -106,11 +106,11 @@ namespace log4net.Util /// <returns>The number of appenders called.</returns> /// <remarks> /// <para> - /// Calls the <see cref="IAppender.DoAppend" /> method on all + /// Calls the <see cref="IAppender.DoAppend" /> method on all /// attached appenders. /// </para> /// </remarks> - public int AppendLoopOnAppenders(LoggingEvent[] loggingEvents) + public int AppendLoopOnAppenders(LoggingEvent[] loggingEvents) { if (loggingEvents == null) { @@ -127,7 +127,7 @@ namespace log4net.Util } // m_appenderList is null when empty - if (m_appenderList == null) + if (m_appenderList == null) { return 0; } @@ -156,7 +156,7 @@ namespace log4net.Util #region Private Static Methods /// <summary> - /// Calls the DoAppende method on the <see cref="IAppender"/> with + /// Calls the DoAppende method on the <see cref="IAppender"/> with /// the <see cref="LoggingEvent"/> objects supplied. /// </summary> /// <param name="appender">The appender</param> @@ -164,7 +164,7 @@ namespace log4net.Util /// <remarks> /// <para> /// If the <paramref name="appender" /> supports the <see cref="IBulkAppender"/> - /// interface then the <paramref name="loggingEvents" /> will be passed + /// interface then the <paramref name="loggingEvents" /> will be passed /// through using that interface. Otherwise the <see cref="LoggingEvent"/> /// objects in the array will be passed one at a time. /// </para> @@ -198,16 +198,16 @@ namespace log4net.Util /// If the appender is already in the list it won't be added again. /// </para> /// </remarks> - public void AddAppender(IAppender newAppender) + public void AddAppender(IAppender newAppender) { // Null values for newAppender parameter are strictly forbidden. if (newAppender == null) { throw new ArgumentNullException("newAppender"); } - + m_appenderArray = null; - if (m_appenderList == null) + if (m_appenderList == null) { m_appenderList = new AppenderCollection(1); } @@ -229,7 +229,7 @@ namespace log4net.Util /// The read only collection of all currently attached appenders. /// </para> /// </remarks> - public AppenderCollection Appenders + public AppenderCollection Appenders { get { @@ -238,7 +238,7 @@ namespace log4net.Util // We must always return a valid collection return AppenderCollection.EmptyCollection; } - else + else { return AppenderCollection.ReadOnly(m_appenderList); } @@ -258,7 +258,7 @@ namespace log4net.Util /// Lookup an attached appender by name. /// </para> /// </remarks> - public IAppender GetAppender(string name) + public IAppender GetAppender(string name) { if (m_appenderList != null && name != null) { @@ -270,7 +270,7 @@ namespace log4net.Util } } } - return null; + return null; } /// <summary> @@ -281,9 +281,9 @@ namespace log4net.Util /// Removes and closes all attached appenders /// </para> /// </remarks> - public void RemoveAllAppenders() + public void RemoveAllAppenders() { - if (m_appenderList != null) + if (m_appenderList != null) { foreach(IAppender appender in m_appenderList) { @@ -296,7 +296,7 @@ namespace log4net.Util LogLog.Error(declaringType, "Failed to Close appender ["+appender.Name+"]", ex); } } - m_appenderList = null; + m_appenderList = null; m_appenderArray = null; } } @@ -313,9 +313,9 @@ namespace log4net.Util /// <see cref="IAppender.Close"/> on the appender removed. /// </para> /// </remarks> - public IAppender RemoveAppender(IAppender appender) + public IAppender RemoveAppender(IAppender appender) { - if (appender != null && m_appenderList != null) + if (appender != null && m_appenderList != null) { m_appenderList.Remove(appender); if (m_appenderList.Count == 0) @@ -339,7 +339,7 @@ namespace log4net.Util /// <see cref="IAppender.Close"/> on the appender removed. /// </para> /// </remarks> - public IAppender RemoveAppender(string name) + public IAppender RemoveAppender(string name) { return RemoveAppender(GetAppender(name)); } http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Util/CompositeProperties.cs ---------------------------------------------------------------------- diff --git a/src/Util/CompositeProperties.cs b/src/Util/CompositeProperties.cs index b491197..f23c8aa 100644 --- a/src/Util/CompositeProperties.cs +++ b/src/Util/CompositeProperties.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -80,7 +80,7 @@ namespace log4net.Util /// </remarks> public object this[string key] { - get + get { // Look in the flattened properties first if (m_flattened != null) http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Util/ContextPropertiesBase.cs ---------------------------------------------------------------------- diff --git a/src/Util/ContextPropertiesBase.cs b/src/Util/ContextPropertiesBase.cs index 9d79fee..29f95f0 100644 --- a/src/Util/ContextPropertiesBase.cs +++ b/src/Util/ContextPropertiesBase.cs @@ -1,10 +1,10 @@ #region Apache License // -// Licensed to the Apache Software Foundation (ASF) under one or more +// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. +// this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with +// (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a5b4204/src/Util/ConverterInfo.cs ---------------------------------------------------------------------- diff --git a/src/Util/ConverterInfo.cs b/src/Util/ConverterInfo.cs index b64edc9..014fac7 100644 --- a/src/Util/ConverterInfo.cs +++ b/src/Util/ConverterInfo.cs @@ -64,7 +64,7 @@ namespace log4net.Util /// </summary> /// <remarks> /// <para> - /// The value specified must extend the + /// The value specified must extend the /// <see cref="PatternConverter"/> type. /// </para> /// </remarks> @@ -75,7 +75,7 @@ namespace log4net.Util } /// <summary> - /// + /// /// </summary> /// <param name="entry"></param> public void AddProperty(PropertyEntry entry) @@ -84,7 +84,7 @@ namespace log4net.Util } /// <summary> - /// + /// /// </summary> public PropertiesDictionary Properties {
