FreeAndNil commented on code in PR #119:
URL: https://github.com/apache/logging-log4net/pull/119#discussion_r1518601919


##########
src/log4net/Appender/FileAppender.cs:
##########
@@ -145,32 +146,29 @@ public override Task WriteAsync(byte[] buffer, int 
offset, int count, Cancellati
         return base.WriteAsync(buffer, offset, count, cancellationToken);
       }
 
-      public override void Flush()
+            public override void Flush()

Review Comment:
   ```suggestion
         public override void Flush()
   ```



##########
src/log4net/Appender/FileAppender.cs:
##########
@@ -779,16 +782,26 @@ public override void ActivateOptions()
       {
         if (m_mutex == null)
         {
-          string mutexFriendlyFilename = CurrentAppender.File
-              .Replace("\\", "_")
-              .Replace(":", "_")
-              .Replace("/", "_");
+          if (CurrentAppender is not null)

Review Comment:
   nit - please only one if: if (CurrentAppender?.File is not null)



##########
src/log4net/Appender/RollingFileAppender.cs:
##########
@@ -1376,19 +1327,22 @@ protected void RollOverSize()
       CloseFile(); // keep windows happy.
 
       LogLog.Debug(declaringType, "rolling over count [" + 
((CountingQuietTextWriter)QuietWriter).Count + "]");
-      LogLog.Debug(declaringType, "maxSizeRollBackups [" + 
m_maxSizeRollBackups + "]");
+      LogLog.Debug(declaringType, "maxSizeRollBackups [" + MaxSizeRollBackups 
+ "]");
       LogLog.Debug(declaringType, "curSizeRollBackups [" + 
m_curSizeRollBackups + "]");
-      LogLog.Debug(declaringType, "countDirection [" + m_countDirection + "]");
+      LogLog.Debug(declaringType, "countDirection [" + CountDirection + "]");
 
-      RollOverRenameFiles(File);
+      if (File is not null)
+      {
+          RollOverRenameFiles(File);

Review Comment:
   ```suggestion
           RollOverRenameFiles(File);
   ```



##########
src/log4net/Appender/FileAppender.cs:
##########
@@ -200,53 +196,50 @@ public override bool CanSeek
       {
         get
         {
-          AssertLocked();
-          return m_realStream.CanSeek;
+          return AssertLocked().CanSeek;
         }
       }
 
       public override bool CanWrite
       {
         get
         {
-          AssertLocked();
-          return m_realStream.CanWrite;
+          return AssertLocked().CanWrite;
         }
       }
 
       public override long Length
       {
         get
         {
-          AssertLocked();
-          return m_realStream.Length;
+          return AssertLocked().Length;
         }
       }
 
       public override long Position
       {
         get
         {
-          AssertLocked();
-          return m_realStream.Position;
+          return AssertLocked().Position;
         }
         set
         {
-          AssertLocked();
-          m_realStream.Position = value;
+          AssertLocked().Position = value;
         }
       }
 
-      #endregion Override Implementation of Stream
+            #endregion Override Implementation of Stream

Review Comment:
   ```suggestion
         #endregion Override Implementation of Stream
   ```



##########
src/log4net/Appender/FileAppender.cs:
##########
@@ -200,53 +196,50 @@ public override bool CanSeek
       {
         get
         {
-          AssertLocked();
-          return m_realStream.CanSeek;
+          return AssertLocked().CanSeek;
         }
       }
 
       public override bool CanWrite
       {
         get
         {
-          AssertLocked();
-          return m_realStream.CanWrite;
+          return AssertLocked().CanWrite;
         }
       }
 
       public override long Length
       {
         get
         {
-          AssertLocked();
-          return m_realStream.Length;
+          return AssertLocked().Length;
         }
       }
 
       public override long Position
       {
         get
         {
-          AssertLocked();
-          return m_realStream.Position;
+          return AssertLocked().Position;
         }
         set
         {
-          AssertLocked();
-          m_realStream.Position = value;
+          AssertLocked().Position = value;
         }
       }
 
-      #endregion Override Implementation of Stream
+            #endregion Override Implementation of Stream
 
-      #region Locking Methods
+            #region Locking Methods

Review Comment:
   ```suggestion
         #region Locking Methods
   ```



##########
src/log4net/Appender/RollingFileAppender.cs:
##########
@@ -18,14 +18,19 @@
 #endregion
 
 using System;
-using System.Collections;
+using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 
 using log4net.Util;
 using log4net.Core;
 using System.Threading;
 
+#nullable enable
+
+[assembly: InternalsVisibleTo("log4net.Tests, 
PublicKey=0024000004800000940000000602000000240000525341310004000001000100297dcac908e28689360399027b0ea4cd852fbb74e1ed95e695a5ba55cbd1d075ec20cdb5fa6fc593d3d571527b20558d6f39e1f4d5cfe0798428c589c311965244b209c38a02aaa8c9da3b72405b6fedeeb4292c3457e9769b74e645c19cb06c2be75fb2d12281a585fbeabf7bd195d6961ba113286fc3e286d7bbd69024ceda")]

Review Comment:
   please move this to AssemblyInfo.cs



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to