logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1165634 - in /logging/log4net/trunk/src: Repository/Hierarchy/Logger.cs Util/SystemStringFormat.cs
Date Tue, 06 Sep 2011 12:20:23 GMT
Author: bodewig
Date: Tue Sep  6 12:20:23 2011
New Revision: 1165634

URL: http://svn.apache.org/viewvc?rev=1165634&view=rev
Log:
.NET 2.0 wraps all non-CLS exceptions in RuntimeWrappedExceptions so the blocks without any
Exception are never reached and create a compiler warning

Modified:
    logging/log4net/trunk/src/Repository/Hierarchy/Logger.cs
    logging/log4net/trunk/src/Util/SystemStringFormat.cs

Modified: logging/log4net/trunk/src/Repository/Hierarchy/Logger.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Repository/Hierarchy/Logger.cs?rev=1165634&r1=1165633&r2=1165634&view=diff
==============================================================================
--- logging/log4net/trunk/src/Repository/Hierarchy/Logger.cs (original)
+++ logging/log4net/trunk/src/Repository/Hierarchy/Logger.cs Tue Sep  6 12:20:23 2011
@@ -432,10 +432,12 @@ namespace log4net.Repository.Hierarchy
 			{
 				log4net.Util.LogLog.Error(declaringType, "Exception while logging", ex);
 			}
+#if !NET_2_0
 			catch
 			{
 				log4net.Util.LogLog.Error(declaringType, "Exception while logging");
 			}
+#endif
 		}
 
 		/// <summary>
@@ -467,10 +469,12 @@ namespace log4net.Repository.Hierarchy
 			{
 				log4net.Util.LogLog.Error(declaringType, "Exception while logging", ex);
 			}
+#if !NET_2_0
 			catch
 			{
 				log4net.Util.LogLog.Error(declaringType, "Exception while logging");
 			}
+#endif
 		}
 
 		/// <summary>
@@ -505,10 +509,12 @@ namespace log4net.Repository.Hierarchy
 			{
 				log4net.Util.LogLog.Error(declaringType, "Exception while logging", ex);
 			}
+#if !NET_2_0
 			catch
 			{
 				log4net.Util.LogLog.Error(declaringType, "Exception while logging");
 			}
+#endif
 			return false;
 		}
 

Modified: logging/log4net/trunk/src/Util/SystemStringFormat.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Util/SystemStringFormat.cs?rev=1165634&r1=1165633&r2=1165634&view=diff
==============================================================================
--- logging/log4net/trunk/src/Util/SystemStringFormat.cs (original)
+++ logging/log4net/trunk/src/Util/SystemStringFormat.cs Tue Sep  6 12:20:23 2011
@@ -109,11 +109,13 @@ namespace log4net.Util
 				log4net.Util.LogLog.Warn(declaringType, "Exception while rendering format ["+format+"]",
ex);
 				return StringFormatError(ex, format, args);
 			}
+#if !NET_2_0
 			catch
 			{
 				log4net.Util.LogLog.Warn(declaringType, "Exception while rendering format ["+format+"]");
 				return StringFormatError(null, format, args);
 			}
+#endif
 		}
 
 		/// <summary>
@@ -146,11 +148,13 @@ namespace log4net.Util
 				log4net.Util.LogLog.Error(declaringType, "INTERNAL ERROR during StringFormat error handling",
ex);
 				return "<log4net.Error>Exception during StringFormat. See Internal Log.</log4net.Error>";
 			}
+#if !NET_2_0
 			catch
 			{
 				log4net.Util.LogLog.Error(declaringType, "INTERNAL ERROR during StringFormat error handling");
 				return "<log4net.Error>Exception during StringFormat. See Internal Log.</log4net.Error>";
 			}
+#endif
 		}
 
 		/// <summary>
@@ -206,10 +210,12 @@ namespace log4net.Util
 				{
 					buffer.Append("<Exception: ").Append(ex.Message).Append(">");
 				}
+#if !NET_2_0
 				catch
 				{
 					buffer.Append("<Exception>");
 				}
+#endif
 			}
 		}
 



Mime
View raw message