logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Bodewig (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LOG4NET-215) Exception on Convert for return %class{1} name
Date Tue, 13 Sep 2011 10:16:08 GMT

     [ https://issues.apache.org/jira/browse/LOG4NET-215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefan Bodewig resolved LOG4NET-215.
------------------------------------

    Resolution: Fixed

fixed with svn revision 1170104

> Exception on Convert for return %class{1} name
> ----------------------------------------------
>
>                 Key: LOG4NET-215
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-215
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.10
>         Environment: Windows XP, Visual Studio 2008, .NET 2.0
>            Reporter: Georgievsky Ilya
>             Fix For: 1.2.11
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> in function^
> override protected void Convert(TextWriter writer, LoggingEvent loggingEvent)
> 		{
> 			string name = GetFullyQualifiedName(loggingEvent);
> 			if (m_precision <= 0)
> 			{
> 				writer.Write(name);
> 			}
> 			else 
> 			{
> 				int len = name.Length;
> 				// We subtract 1 from 'len' when assigning to 'end' to avoid out of
> 				// bounds exception in return name.Substring(end+1, len). This can happen if
> 				// precision is 1 and the logger name ends with a dot. 
> 				int end = len - 1;
> 				for(int i=m_precision; i>0; i--) 
> 				{
>                     end = name.LastIndexOf('.', end - 1);
> 					if (end == -1)
> 					{
> 						writer.Write(name);
> 						return;
> 					}
> 				}
> 				writer.Write(name.Substring(end+1, len-end-1));
> 			}	  
> 		}
> if "string name = GetFullyQualifiedName(loggingEvent); " return '?' (noname class-name)
in line "end = name.LastIndexOf('.', end - 1);" exceptrion because end = 0...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message