logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1167457 - /logging/log4net/trunk/src/Core/DefaultRepositorySelector.cs
Date Sat, 10 Sep 2011 05:07:07 GMT
Author: bodewig
Date: Sat Sep 10 05:07:07 2011
New Revision: 1167457

URL: http://svn.apache.org/viewvc?rev=1167457&view=rev
Log:
TryParse has been introduced in .NET 2.0.  LOG4NET-246

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

Modified: logging/log4net/trunk/src/Core/DefaultRepositorySelector.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Core/DefaultRepositorySelector.cs?rev=1167457&r1=1167456&r2=1167457&view=diff
==============================================================================
--- logging/log4net/trunk/src/Core/DefaultRepositorySelector.cs (original)
+++ logging/log4net/trunk/src/Core/DefaultRepositorySelector.cs Sat Sep 10 05:07:07 2011
@@ -705,7 +705,24 @@ namespace log4net.Core
 
                     // Determine whether to watch the file or not based on an app setting
value:
 				    bool watchRepositoryConfigFile = false;
+#if NET_2_0
 				    Boolean.TryParse(SystemInfo.GetAppSetting("log4net.Config.Watch"), out watchRepositoryConfigFile);
+#else
+                                    {
+                                        string watch = SystemInfo.GetAppSetting("log4net.Config.Watch");
+                                        if (watch != null && watch.Length > 0)
+                                        {
+                                            try
+                                            {
+                                                watchRepositoryConfigFile = Boolean.Parse(watch);
+                                            }
+                                            catch (FormatException)
+                                            {
+                                                // simply not a Boolean
+                                            }
+                                        }
+                                    }
+#endif
 
 					if (watchRepositoryConfigFile)
 					{



Mime
View raw message