Skip to content

Commit 0d28b44

Browse files
committed
release: v1.0.5
1 parent 64c2faa commit 0d28b44

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

CommonAssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
[assembly: ComVisible(false)]
1010

1111
[assembly: AssemblyVersion("1.0.0.0")]
12-
[assembly: AssemblyInformationalVersion("1.0.4")]
12+
[assembly: AssemblyInformationalVersion("1.0.5")]
1313

1414
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Serilog.Sinks.File.Archive.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010025498721eb03bb1731fc4b9646dba1ccf8b4200219d34d57cd538162531409077fdfeead7efbeef28c352fa5e08e2010f2bfe3ae75d7a18a736b5a9c075ba69f0d8da5bfab51b53e23b9214eb8957e992dd31ed94d49ba8d6cc72cf79c06e1085a43559b9644a4b7d621c2d64baf6cc2edc2ae754a0f8f77faccb71cbb1d22df")]

src/Serilog.Sinks.File.Archive/ArchiveHooks.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public override void OnFileDeleting(string path)
9898
sourceStream.CopyTo(compressStream);
9999
}
100100
}
101-
//only apply archive file limit if we are archiving to a non tokenised path (constant path)
101+
102+
// Only apply archive file limit if we are archiving to a non-tokenised path (a constant path)
102103
if (this.retainedFileCountLimit > 0 && !this.IsArchivePathTokenised)
103104
{
104105
RemoveExcessFiles(currentTargetDir);
@@ -124,6 +125,7 @@ private void RemoveExcessFiles(string folder)
124125
.OrderByDescending(f => f, LogFileComparer.Default)
125126
.Skip(this.retainedFileCountLimit)
126127
.ToList();
128+
127129
foreach (var file in filesToDelete)
128130
{
129131
try
@@ -141,9 +143,9 @@ private class LogFileComparer : IComparer<FileInfo>
141143
{
142144
public static IComparer<FileInfo> Default = new LogFileComparer();
143145

144-
//This will not work correctly when the file uses a date format where lexicographical order does not correspond to chronological order but frankly, if you
145-
//are using non ISO 8601 date formats in your files you should be shot.
146-
//It would be best if the file sink could expose a way to sort files chronologically because I think LastWriteTime is probably not determisitic enough.
146+
// This will not work correctly when the file uses a date format where lexicographical order does not
147+
// correspond to chronological order - but frankly, if you are using non ISO 8601 date formats in your
148+
// files you should be shot :)
147149
public int Compare(FileInfo x, FileInfo y)
148150
{
149151
if (x is null && y is null)
@@ -152,7 +154,8 @@ public int Compare(FileInfo x, FileInfo y)
152154
return -1;
153155
if (y is null)
154156
return 1;
155-
return string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
157+
158+
return String.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
156159
}
157160
}
158161
}

src/Serilog.Sinks.File.Archive/Serilog.Sinks.File.Archive.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Description>Plugin for the Serilog File sink that archives completed log files, optionally compressing them.</Description>
5-
<VersionPrefix>1.0.4</VersionPrefix>
5+
<VersionPrefix>1.0.5</VersionPrefix>
66
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
77
<Authors>Colin Anderson</Authors>
88
<Copyright>Copyright © Colin Anderson 2020</Copyright>

test/Serilog.Sinks.File.Archive.Test/Serilog.Sinks.File.Archive.Test.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
13+
<PackageReference Include="xunit" Version="2.7.0" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
15+
16+
<!-- newer versions no longer support net45 -->
1317
<PackageReference Include="Shouldly" Version="4.0.0-beta0002" />
14-
<PackageReference Include="xunit" Version="2.4.1" />
15-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
1618
</ItemGroup>
1719

1820
<ItemGroup>

0 commit comments

Comments
 (0)