Compare commits

...

2 commits

Author SHA1 Message Date
Ell
4d5478bcf2 1.3.1 2023-05-08 11:02:57 +02:00
Ell
205dde65c3 write to log files with read-write file share enabled 2023-05-08 11:02:25 +02:00
3 changed files with 4 additions and 4 deletions

View file

@ -114,7 +114,7 @@ namespace ExtremelySimpleLogger {
private StreamWriter Append() { private StreamWriter Append() {
try { try {
return this.file.AppendText(); return new StreamWriter(this.file.Open(FileMode.Append, FileAccess.Write, FileShare.ReadWrite));
} catch (Exception e) { } catch (Exception e) {
throw new IOException($"Failed to append to directory sink file {this.file}", e); throw new IOException($"Failed to append to directory sink file {this.file}", e);
} }

View file

@ -14,7 +14,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile> <PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>Logo.png</PackageIcon> <PackageIcon>Logo.png</PackageIcon>
<VersionPrefix>1.3.0</VersionPrefix> <VersionPrefix>1.3.1</VersionPrefix>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -16,7 +16,7 @@ namespace ExtremelySimpleLogger {
return this.file; return this.file;
} }
} }
private const int OneGb = 1024 * 1024 * 1024; private const int OneGb = 1024 * 1024 * 1024;
private readonly FileInfo file; private readonly FileInfo file;
private readonly StreamWriter writer; private readonly StreamWriter writer;
@ -94,7 +94,7 @@ namespace ExtremelySimpleLogger {
private StreamWriter Append() { private StreamWriter Append() {
try { try {
return this.file.AppendText(); return new StreamWriter(this.file.Open(FileMode.Append, FileAccess.Write, FileShare.ReadWrite));
} catch (Exception e) { } catch (Exception e) {
throw new IOException($"Failed to append to file sink {this.file}", e); throw new IOException($"Failed to append to file sink {this.file}", e);
} }