Return-Path: X-Original-To: apmail-logging-commits-archive@minotaur.apache.org Delivered-To: apmail-logging-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5B283C491 for ; Tue, 25 Jun 2013 06:21:34 +0000 (UTC) Received: (qmail 94639 invoked by uid 500); 25 Jun 2013 06:21:33 -0000 Delivered-To: apmail-logging-commits-archive@logging.apache.org Received: (qmail 94617 invoked by uid 500); 25 Jun 2013 06:21:30 -0000 Mailing-List: contact commits-help@logging.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@logging.apache.org Delivered-To: mailing list commits@logging.apache.org Received: (qmail 94610 invoked by uid 99); 25 Jun 2013 06:21:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jun 2013 06:21:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jun 2013 06:21:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D771823889ED; Tue, 25 Jun 2013 06:21:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1496356 - /logging/log4net/trunk/src/Core/StackFrameItem.cs Date: Tue, 25 Jun 2013 06:21:08 -0000 To: commits@logging.apache.org From: dpsenner@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130625062108.D771823889ED@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 + ')';