logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpsen...@apache.org
Subject svn commit: r1496356 - /logging/log4net/trunk/src/Core/StackFrameItem.cs
Date Tue, 25 Jun 2013 06:21:08 GMT
Author: dpsenner
Date: Tue Jun 25 06:21:08 2013
New Revision: 1496356

URL: http://svn.apache.org/r1496356
Log:
LOG4NET-341 fix stack frame item compilation warning

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

Modified: logging/log4net/trunk/src/Core/StackFrameItem.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Core/StackFrameItem.cs?rev=1496356&r1=1496355&r2=1496356&view=diff
==============================================================================
--- logging/log4net/trunk/src/Core/StackFrameItem.cs (original)
+++ logging/log4net/trunk/src/Core/StackFrameItem.cs Tue Jun 25 06:21:08 2013
@@ -20,7 +20,8 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Diagnostics;
-using System.Reflection;
+using System.Reflection;
+using log4net.Util;
 
 namespace log4net.Core
 {
@@ -47,18 +48,25 @@ namespace log4net.Core
             m_lineNumber = NA;
             m_fileName = NA;
             m_method = new MethodItem();
-            m_className = NA;
-
-            // get frame values
-            m_lineNumber = frame.GetFileLineNumber().ToString(System.Globalization.NumberFormatInfo.InvariantInfo);
-            m_fileName = frame.GetFileName();
-            // get method values
-            MethodBase method = frame.GetMethod();
-            if (method != null)
-            {
-				m_className = method.DeclaringType.FullName;
-				m_method = new MethodItem(method);
-            }
+            m_className = NA;
+
+			try
+			{
+				// get frame values
+				m_lineNumber = frame.GetFileLineNumber().ToString(System.Globalization.NumberFormatInfo.InvariantInfo);
+				m_fileName = frame.GetFileName();
+				// get method values
+				MethodBase method = frame.GetMethod();
+				if (method != null)
+				{
+					m_className = method.DeclaringType.FullName;
+					m_method = new MethodItem(method);
+				}
+			}
+			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
+ ')';



Mime
View raw message