Author: bodewig
Date: Sun Oct 16 10:44:47 2016
New Revision: 1765137

URL: http://svn.apache.org/viewvc?rev=1765137&view=rev
Log:
LOG4NET-511 make #37 compile for .NET 2.0 and .NET Core

Modified:
    logging/log4net/trunk/src/Appender/DebugAppender.cs
    logging/log4net/trunk/src/Appender/IFlushable.cs
    logging/log4net/trunk/src/LogManager.cs
    logging/log4net/trunk/src/Repository/LoggerRepositorySkeleton.cs

Modified: logging/log4net/trunk/src/Appender/DebugAppender.cs
URL: 
http://svn.apache.org/viewvc/logging/log4net/trunk/src/Appender/DebugAppender.cs?rev=1765137&r1=1765136&r2=1765137&view=diff
==============================================================================
--- logging/log4net/trunk/src/Appender/DebugAppender.cs (original)
+++ logging/log4net/trunk/src/Appender/DebugAppender.cs Sun Oct 16 10:44:47 2016
@@ -40,7 +40,10 @@ namespace log4net.Appender
        /// </para>
        /// </remarks>
        /// <author>Nicko Cadell</author>
-    public class DebugAppender : AppenderSkeleton, IFlushable
+    public class DebugAppender : AppenderSkeleton
+#if !NETSTANDARD1_3
+                               , IFlushable
+#endif
        {
                #region Public Instance Constructors
 
@@ -102,7 +105,7 @@ namespace log4net.Appender
 
                #endregion Public Instance Properties
 
-
+#if !NETSTANDARD1_3
             /// <summary>
             /// Flushes any buffered log data.
             /// </summary>
@@ -118,6 +121,7 @@ namespace log4net.Appender
 
                 return true;
             }
+#endif
 
                #region Override implementation of AppenderSkeleton
 

Modified: logging/log4net/trunk/src/Appender/IFlushable.cs
URL: 
http://svn.apache.org/viewvc/logging/log4net/trunk/src/Appender/IFlushable.cs?rev=1765137&r1=1765136&r2=1765137&view=diff
==============================================================================
--- logging/log4net/trunk/src/Appender/IFlushable.cs (original)
+++ logging/log4net/trunk/src/Appender/IFlushable.cs Sun Oct 16 10:44:47 2016
@@ -1,8 +1,4 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace log4net.Appender
 {

Modified: logging/log4net/trunk/src/LogManager.cs
URL: 
http://svn.apache.org/viewvc/logging/log4net/trunk/src/LogManager.cs?rev=1765137&r1=1765136&r2=1765137&view=diff
==============================================================================
--- logging/log4net/trunk/src/LogManager.cs (original)
+++ logging/log4net/trunk/src/LogManager.cs Sun Oct 16 10:44:47 2016
@@ -754,11 +754,11 @@ namespace log4net
             /// <summary>
             /// Flushes logging events buffered in all configured appenders in 
the default repository.
             /// </summary>
-            /// <param name="millisecondsTimeout">The maximum time in 
milliseconds to wait for logging events from asycnhronous appenders to be 
flushed,
-            /// or <see cref="Timeout.Infinite"/> to wait indefinitely.</param>
+            /// <param name="millisecondsTimeout">The maximum time in 
milliseconds to wait for logging events from asycnhronous appenders to be 
flushed.</param>
             /// <returns><c>True</c> if all logging events were flushed 
successfully, else <c>false</c>.</returns>
             public static bool Flush(int millisecondsTimeout)
             {
+#if !NETSTANDARD1_3 // Excluded because GetCallingAssembly() is not available 
in CoreFX (https://github.com/dotnet/corefx/issues/2221).
                 Appender.IFlushable flushableRepository = 
LoggerManager.GetRepository(Assembly.GetCallingAssembly()) as 
Appender.IFlushable;
                 if (flushableRepository == null)
                 {
@@ -768,6 +768,9 @@ namespace log4net
                 {
                     return flushableRepository.Flush(millisecondsTimeout);
                 }
+#else
+                return false;
+#endif
             }
 
                #endregion Domain & Repository Manager Methods

Modified: logging/log4net/trunk/src/Repository/LoggerRepositorySkeleton.cs
URL: 
http://svn.apache.org/viewvc/logging/log4net/trunk/src/Repository/LoggerRepositorySkeleton.cs?rev=1765137&r1=1765136&r2=1765137&view=diff
==============================================================================
--- logging/log4net/trunk/src/Repository/LoggerRepositorySkeleton.cs (original)
+++ logging/log4net/trunk/src/Repository/LoggerRepositorySkeleton.cs Sun Oct 16 
10:44:47 2016
@@ -603,7 +603,7 @@ namespace log4net.Repository
             DateTime startTimeUtc = DateTime.UtcNow;
 
             // Do buffering appenders first.  These may be forwarding to other 
appenders
-            foreach(var appender in GetAppenders())
+            foreach(log4net.Appender.IAppender appender in GetAppenders())
             {
                 log4net.Appender.IFlushable flushable = appender as 
log4net.Appender.IFlushable;
                 if (flushable == null) continue;
@@ -615,7 +615,7 @@ namespace log4net.Repository
             }
 
             // Do non-buffering appenders.
-            foreach (var appender in GetAppenders())
+            foreach (log4net.Appender.IAppender appender in GetAppenders())
             {
                 log4net.Appender.IFlushable flushable = appender as 
log4net.Appender.IFlushable;
                 if (flushable == null) continue;


Reply via email to