logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpsen...@apache.org
Subject svn commit: r1496365 - in /logging/log4net/trunk/src/Core: MethodItem.cs StackFrameItem.cs
Date Tue, 25 Jun 2013 07:32:03 GMT
Author: dpsenner
Date: Tue Jun 25 07:32:02 2013
New Revision: 1496365

URL: http://svn.apache.org/r1496365
Log:
Fix unused references to the System.Collections.Generic namespace

This should fix the compilation errors against mono 1.0.

Modified:
    logging/log4net/trunk/src/Core/MethodItem.cs
    logging/log4net/trunk/src/Core/StackFrameItem.cs

Modified: logging/log4net/trunk/src/Core/MethodItem.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Core/MethodItem.cs?rev=1496365&r1=1496364&r2=1496365&view=diff
==============================================================================
--- logging/log4net/trunk/src/Core/MethodItem.cs (original)
+++ logging/log4net/trunk/src/Core/MethodItem.cs Tue Jun 25 07:32:02 2013
@@ -1,172 +1,171 @@
-#region Apache License
-//
-// 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. 
-// 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 obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Collections;
-
-using log4net.Util;
-
-namespace log4net.Core
-{
-	/// <summary>
-	/// provides method information without actually referencing a System.Reflection.MethodBase
-	/// as that would require that the containing assembly is loaded.
-	/// </summary>
-	/// 
-#if !NETCF
-	[Serializable]
-#endif
-	public class MethodItem
-	{
-		#region Public Instance Constructors
-
+#region Apache License
+//
+// 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. 
+// 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 obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+using System;
+using System.Text;
+using System.Collections;
+
+using log4net.Util;
+
+namespace log4net.Core
+{
+	/// <summary>
+	/// provides method information without actually referencing a System.Reflection.MethodBase
+	/// as that would require that the containing assembly is loaded.
+	/// </summary>
+	/// 
+#if !NETCF
+	[Serializable]
+#endif
+	public class MethodItem
+	{
+		#region Public Instance Constructors
+
 		/// <summary>
 		/// constructs a method item for an unknown method.
-		/// </summary>
-		public MethodItem()
-		{
-			m_name = NA;
-			m_parameters = new string[0];
-		}
-
+		/// </summary>
+		public MethodItem()
+		{
+			m_name = NA;
+			m_parameters = new string[0];
+		}
+
 		/// <summary>
 		/// constructs a method item from the name of the method.
 		/// </summary>
-		/// <param name="name"></param>
-		public MethodItem(string name)
-			: this()
-		{
-			m_name = name;
-		}
-
+		/// <param name="name"></param>
+		public MethodItem(string name)
+			: this()
+		{
+			m_name = name;
+		}
+
 		/// <summary>
 		/// constructs a method item from the name of the method and its parameters.
 		/// </summary>
 		/// <param name="name"></param>
-		/// <param name="parameters"></param>
-		public MethodItem(string name, string[] parameters)
-			: this(name)
-		{
-			m_parameters = parameters;
-		}
-
+		/// <param name="parameters"></param>
+		public MethodItem(string name, string[] parameters)
+			: this(name)
+		{
+			m_parameters = parameters;
+		}
+
         /// <summary>
         /// constructs a method item from a method base by determining the method name and
its parameters.
         /// </summary>
-        /// <param name="methodBase"></param>
-		public MethodItem(System.Reflection.MethodBase methodBase)
-			: this(methodBase.Name, GetMethodParameterNames(methodBase))
-        {
-		}
-
-		#endregion
-
-		private static string[] GetMethodParameterNames(System.Reflection.MethodBase methodBase)
-		{
-			ArrayList methodParameterNames = new ArrayList();
-			try
-			{
-				System.Reflection.ParameterInfo[] methodBaseGetParameters = methodBase.GetParameters();
-
-				int methodBaseGetParametersCount = methodBaseGetParameters.GetUpperBound(0);
-
-				for (int i = 0; i <= methodBaseGetParametersCount; i++)
-				{
-					methodParameterNames.Add(methodBaseGetParameters[i].ParameterType + " " + methodBaseGetParameters[i].Name);
-				}
-			}
-			catch (Exception ex)
-			{
-				LogLog.Error(declaringType, "An exception ocurred while retreiving method parameters.",
ex);
-			}
-
-			return (string[])methodParameterNames.ToArray(typeof(string));
-		}
-
-		#region Public Instance Properties
-
-		/// <summary>
-		/// Gets the method name of the caller making the logging 
-		/// request.
-		/// </summary>
-		/// <value>
-		/// The method name of the caller making the logging 
-		/// request.
-		/// </value>
-		/// <remarks>
-		/// <para>
-		/// Gets the method name of the caller making the logging 
-		/// request.
-		/// </para>
-		/// </remarks>
-		public string Name
-		{
-			get { return m_name; }
-		}
-
-		/// <summary>
-		/// Gets the method parameters of the caller making
-		/// the logging request.
-		/// </summary>
-		/// <value>
-		/// The method parameters of the caller making
-		/// the logging request
-		/// </value>
-		/// <remarks>
-		/// <para>
-		/// Gets the method parameters of the caller making
-		/// the logging request.
-		/// </para>
-		/// </remarks>
-		public string[] Parameters
-		{
-			get { return m_parameters; }
-		}
-
-		#endregion
-
-		#region Private Instance Fields
-
-		private readonly string m_name;
-		private readonly string[] m_parameters;
-
-		#endregion
-
-		#region Private Static Fields
-
-		/// <summary>
-		/// The fully qualified type of the StackFrameItem class.
-		/// </summary>
-		/// <remarks>
-		/// Used by the internal logger to record the Type of the
-		/// log message.
-		/// </remarks>
-		private readonly static Type declaringType = typeof(MethodItem);
-
-		/// <summary>
-		/// When location information is not available the constant
-		/// <c>NA</c> is returned. Current value of this string
-		/// constant is <b>?</b>.
-		/// </summary>
-		private const string NA = "?";
-
-		#endregion Private Static Fields
-	}
-}
+        /// <param name="methodBase"></param>
+		public MethodItem(System.Reflection.MethodBase methodBase)
+			: this(methodBase.Name, GetMethodParameterNames(methodBase))
+        {
+		}
+
+		#endregion
+
+		private static string[] GetMethodParameterNames(System.Reflection.MethodBase methodBase)
+		{
+			ArrayList methodParameterNames = new ArrayList();
+			try
+			{
+				System.Reflection.ParameterInfo[] methodBaseGetParameters = methodBase.GetParameters();
+
+				int methodBaseGetParametersCount = methodBaseGetParameters.GetUpperBound(0);
+
+				for (int i = 0; i <= methodBaseGetParametersCount; i++)
+				{
+					methodParameterNames.Add(methodBaseGetParameters[i].ParameterType + " " + methodBaseGetParameters[i].Name);
+				}
+			}
+			catch (Exception ex)
+			{
+				LogLog.Error(declaringType, "An exception ocurred while retreiving method parameters.",
ex);
+			}
+
+			return (string[])methodParameterNames.ToArray(typeof(string));
+		}
+
+		#region Public Instance Properties
+
+		/// <summary>
+		/// Gets the method name of the caller making the logging 
+		/// request.
+		/// </summary>
+		/// <value>
+		/// The method name of the caller making the logging 
+		/// request.
+		/// </value>
+		/// <remarks>
+		/// <para>
+		/// Gets the method name of the caller making the logging 
+		/// request.
+		/// </para>
+		/// </remarks>
+		public string Name
+		{
+			get { return m_name; }
+		}
+
+		/// <summary>
+		/// Gets the method parameters of the caller making
+		/// the logging request.
+		/// </summary>
+		/// <value>
+		/// The method parameters of the caller making
+		/// the logging request
+		/// </value>
+		/// <remarks>
+		/// <para>
+		/// Gets the method parameters of the caller making
+		/// the logging request.
+		/// </para>
+		/// </remarks>
+		public string[] Parameters
+		{
+			get { return m_parameters; }
+		}
+
+		#endregion
+
+		#region Private Instance Fields
+
+		private readonly string m_name;
+		private readonly string[] m_parameters;
+
+		#endregion
+
+		#region Private Static Fields
+
+		/// <summary>
+		/// The fully qualified type of the StackFrameItem class.
+		/// </summary>
+		/// <remarks>
+		/// Used by the internal logger to record the Type of the
+		/// log message.
+		/// </remarks>
+		private readonly static Type declaringType = typeof(MethodItem);
+
+		/// <summary>
+		/// When location information is not available the constant
+		/// <c>NA</c> is returned. Current value of this string
+		/// constant is <b>?</b>.
+		/// </summary>
+		private const string NA = "?";
+
+		#endregion Private Static Fields
+	}
+}

Modified: logging/log4net/trunk/src/Core/StackFrameItem.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Core/StackFrameItem.cs?rev=1496365&r1=1496364&r2=1496365&view=diff
==============================================================================
--- logging/log4net/trunk/src/Core/StackFrameItem.cs (original)
+++ logging/log4net/trunk/src/Core/StackFrameItem.cs Tue Jun 25 07:32:02 2013
@@ -1,53 +1,52 @@
-#region Apache License
-//
-// 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. 
-// 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 obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
+#region Apache License
+//
+// 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. 
+// 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 obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+using System;
+using System.Text;
+using System.Diagnostics;
 using System.Reflection;
-using log4net.Util;
-
-namespace log4net.Core
-{
-    /// <summary>
-    /// provides stack frame information without actually referencing a System.Diagnostics.StackFrame
-    /// as that would require that the containing assembly is loaded.
-    /// </summary>
-    /// 
-#if !NETCF
-    [Serializable]
-#endif
-    public class StackFrameItem
-    {
-        #region Public Instance Constructors
-
-        /// <summary>
-        /// returns a stack frame item from a stack frame. This 
-        /// </summary>
-        /// <param name="frame"></param>
-        /// <returns></returns>
-        public StackFrameItem(StackFrame frame)
-        {
-            // set default values
-            m_lineNumber = NA;
-            m_fileName = NA;
-            m_method = new MethodItem();
+using log4net.Util;
+
+namespace log4net.Core
+{
+    /// <summary>
+    /// provides stack frame information without actually referencing a System.Diagnostics.StackFrame
+    /// as that would require that the containing assembly is loaded.
+    /// </summary>
+    /// 
+#if !NETCF
+    [Serializable]
+#endif
+    public class StackFrameItem
+    {
+        #region Public Instance Constructors
+
+        /// <summary>
+        /// returns a stack frame item from a stack frame. This 
+        /// </summary>
+        /// <param name="frame"></param>
+        /// <returns></returns>
+        public StackFrameItem(StackFrame frame)
+        {
+            // set default values
+            m_lineNumber = NA;
+            m_fileName = NA;
+            m_method = new MethodItem();
             m_className = NA;
 
 			try
@@ -66,131 +65,131 @@ namespace log4net.Core
 			catch (Exception ex)
 			{
 				LogLog.Error(declaringType, "An exception ocurred while retreiving stack frame information.",
ex);
-			}
-
-            // set full info
-            m_fullInfo = m_className + '.' + m_method.Name + '(' + m_fileName + ':' + m_lineNumber
+ ')';
-        }
-
-        #endregion
-
-        #region Public Instance Properties
-
-        /// <summary>
-        /// Gets the fully qualified class name of the caller making the logging 
-        /// request.
-        /// </summary>
-        /// <value>
-        /// The fully qualified class name of the caller making the logging 
-        /// request.
-        /// </value>
-        /// <remarks>
-        /// <para>
-        /// Gets the fully qualified class name of the caller making the logging 
-        /// request.
-        /// </para>
-        /// </remarks>
-        public string ClassName
-        {
-            get { return m_className; }
-        }
-
-        /// <summary>
-        /// Gets the file name of the caller.
-        /// </summary>
-        /// <value>
-        /// The file name of the caller.
-        /// </value>
-        /// <remarks>
-        /// <para>
-        /// Gets the file name of the caller.
-        /// </para>
-        /// </remarks>
-        public string FileName
-        {
-            get { return m_fileName; }
-        }
-
-        /// <summary>
-        /// Gets the line number of the caller.
-        /// </summary>
-        /// <value>
-        /// The line number of the caller.
-        /// </value>
-        /// <remarks>
-        /// <para>
-        /// Gets the line number of the caller.
-        /// </para>
-        /// </remarks>
-        public string LineNumber
-        {
-            get { return m_lineNumber; }
-        }
-
-        /// <summary>
-        /// Gets the method name of the caller.
-        /// </summary>
-        /// <value>
-        /// The method name of the caller.
-        /// </value>
-        /// <remarks>
-        /// <para>
-        /// Gets the method name of the caller.
-        /// </para>
-        /// </remarks>
-        public MethodItem Method
-        {
-            get { return m_method; }
-        }
-
-        /// <summary>
-        /// Gets all available caller information
-        /// </summary>
-        /// <value>
-        /// All available caller information, in the format
-        /// <c>fully.qualified.classname.of.caller.methodName(Filename:line)</c>
-        /// </value>
-        /// <remarks>
-        /// <para>
-        /// Gets all available caller information, in the format
-        /// <c>fully.qualified.classname.of.caller.methodName(Filename:line)</c>
-        /// </para>
-        /// </remarks>
-        public string FullInfo
-        {
-            get { return m_fullInfo; }
-        }
-
-        #endregion Public Instance Properties
-
-        #region Private Instance Fields
-
-        private readonly string m_lineNumber;
-        private readonly string m_fileName;
-        private readonly string m_className;
-        private readonly string m_fullInfo;
-		private readonly MethodItem m_method;
-
-        #endregion
-
-        #region Private Static Fields
-
-        /// <summary>
-        /// The fully qualified type of the StackFrameItem class.
-        /// </summary>
-        /// <remarks>
-        /// Used by the internal logger to record the Type of the
-        /// log message.
-        /// </remarks>
-        private readonly static Type declaringType = typeof(StackFrameItem);
-
-        /// <summary>
-        /// When location information is not available the constant
-        /// <c>NA</c> is returned. Current value of this string
-        /// constant is <b>?</b>.
-        /// </summary>
-        private const string NA = "?";
-
-        #endregion Private Static Fields
-    }
-}
+			}
+
+            // set full info
+            m_fullInfo = m_className + '.' + m_method.Name + '(' + m_fileName + ':' + m_lineNumber
+ ')';
+        }
+
+        #endregion
+
+        #region Public Instance Properties
+
+        /// <summary>
+        /// Gets the fully qualified class name of the caller making the logging 
+        /// request.
+        /// </summary>
+        /// <value>
+        /// The fully qualified class name of the caller making the logging 
+        /// request.
+        /// </value>
+        /// <remarks>
+        /// <para>
+        /// Gets the fully qualified class name of the caller making the logging 
+        /// request.
+        /// </para>
+        /// </remarks>
+        public string ClassName
+        {
+            get { return m_className; }
+        }
+
+        /// <summary>
+        /// Gets the file name of the caller.
+        /// </summary>
+        /// <value>
+        /// The file name of the caller.
+        /// </value>
+        /// <remarks>
+        /// <para>
+        /// Gets the file name of the caller.
+        /// </para>
+        /// </remarks>
+        public string FileName
+        {
+            get { return m_fileName; }
+        }
+
+        /// <summary>
+        /// Gets the line number of the caller.
+        /// </summary>
+        /// <value>
+        /// The line number of the caller.
+        /// </value>
+        /// <remarks>
+        /// <para>
+        /// Gets the line number of the caller.
+        /// </para>
+        /// </remarks>
+        public string LineNumber
+        {
+            get { return m_lineNumber; }
+        }
+
+        /// <summary>
+        /// Gets the method name of the caller.
+        /// </summary>
+        /// <value>
+        /// The method name of the caller.
+        /// </value>
+        /// <remarks>
+        /// <para>
+        /// Gets the method name of the caller.
+        /// </para>
+        /// </remarks>
+        public MethodItem Method
+        {
+            get { return m_method; }
+        }
+
+        /// <summary>
+        /// Gets all available caller information
+        /// </summary>
+        /// <value>
+        /// All available caller information, in the format
+        /// <c>fully.qualified.classname.of.caller.methodName(Filename:line)</c>
+        /// </value>
+        /// <remarks>
+        /// <para>
+        /// Gets all available caller information, in the format
+        /// <c>fully.qualified.classname.of.caller.methodName(Filename:line)</c>
+        /// </para>
+        /// </remarks>
+        public string FullInfo
+        {
+            get { return m_fullInfo; }
+        }
+
+        #endregion Public Instance Properties
+
+        #region Private Instance Fields
+
+        private readonly string m_lineNumber;
+        private readonly string m_fileName;
+        private readonly string m_className;
+        private readonly string m_fullInfo;
+		private readonly MethodItem m_method;
+
+        #endregion
+
+        #region Private Static Fields
+
+        /// <summary>
+        /// The fully qualified type of the StackFrameItem class.
+        /// </summary>
+        /// <remarks>
+        /// Used by the internal logger to record the Type of the
+        /// log message.
+        /// </remarks>
+        private readonly static Type declaringType = typeof(StackFrameItem);
+
+        /// <summary>
+        /// When location information is not available the constant
+        /// <c>NA</c> is returned. Current value of this string
+        /// constant is <b>?</b>.
+        /// </summary>
+        private const string NA = "?";
+
+        #endregion Private Static Fields
+    }
+}



Mime
View raw message