[PATCH 4 of 5] Step 4: use the new functionality

2013-01-22 Thread Dominik Psenner
diff -r 569e06c6cfb3 -r c4b727dc790c src/Appender/RollingFileAppender.cs
--- a/src/Appender/RollingFileAppender.cs   Tue Jan 22 14:31:43 2013 +0100
+++ b/src/Appender/RollingFileAppender.cs   Tue Jan 22 14:31:58 2013 +0100
@@ -835,6 +835,11 @@
}
}
}
+
+   if (m_rollDate)
+   {
+   DeleteOutdatedFiles();
+   }
}
 
/// summary
@@ -1243,12 +1248,18 @@
{
string from = CombinePath(File, . + 
i);
string to = 
CombinePath(m_scheduledFilename, . + i);
-   RollFile(from, to);
+   if (FileExists(from)) // to avoid file 
not exists warning because that's legal here
+   {
+   RollFile(from, to);
+   }
}
 
RollFile(File, m_scheduledFilename);
}
 
+   //Now we delete files too old to keep (see 
m_maxDateRollBackups)
+   DeleteOutdatedFiles();
+
//We've cleared out the old date and are ready for the 
new
m_curSizeRollBackups = 0;
 


Re: [PATCH 4 of 5] Step 4: use the new functionality

2013-01-22 Thread Dominik Psenner

On 01/22/2013 02:41 PM, Dominik Psenner wrote:

diff -r 569e06c6cfb3 -r c4b727dc790c src/Appender/RollingFileAppender.cs
--- a/src/Appender/RollingFileAppender.cs   Tue Jan 22 14:31:43 2013 +0100
+++ b/src/Appender/RollingFileAppender.cs   Tue Jan 22 14:31:58 2013 +0100
@@ -835,6 +835,11 @@
}
}
}
+
+   if (m_rollDate)
+   {
+   DeleteOutdatedFiles();
+   }
}
  
  		/// summary

@@ -1243,12 +1248,18 @@
{
string from = CombinePath(File, . + 
i);
string to = CombinePath(m_scheduledFilename, 
. + i);
-   RollFile(from, to);
+   if (FileExists(from)) // to avoid file 
not exists warning because that's legal here
+   {
+   RollFile(from, to);
+   }
}
  
  RollFile(File, m_scheduledFilename);

}
  
+			//Now we delete files too old to keep (see m_maxDateRollBackups)

+   DeleteOutdatedFiles();
+
//We've cleared out the old date and are ready for the 
new
m_curSizeRollBackups = 0;
  
This patch does not make sense without the previous patch. So the 
functionality is basically hidden in the previous patch that claims to 
be doing nothing. I'm aborting the review here. Please split the patches 
into as many pieces as needed so that they are easily review-able. That 
would be great!