Skip to content

Commit 1b029c8

Browse files
committed
PR code review items from #23
1 parent 5336190 commit 1b029c8

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/Serilog.Sinks.File/Sinks/File/WriteCountingStream.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public override long Position
6060

6161
public override long Seek(long offset, SeekOrigin origin)
6262
{
63-
return _stream.Seek(offset, origin);
63+
throw new InvalidOperationException($"Seek operations are not available through `{nameof(WriteCountingStream)}`.");
6464
}
6565

6666
public override void SetLength(long value)

test/Serilog.Sinks.File.Tests/FileSinkTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ public void WhenLimitIsNotSpecifiedAndEncodingHasNoPreambleDataIsCorrectlyAppend
143143
WriteTwoEventsAndCheckOutputFileLength(maxBytes, encoding);
144144
}
145145

146-
private static void WriteTwoEventsAndCheckOutputFileLength(long? maxBytes, Encoding encoding)
146+
static void WriteTwoEventsAndCheckOutputFileLength(long? maxBytes, Encoding encoding)
147147
{
148148
using (var tmp = TempFolder.ForCaller())
149149
{
150150
var path = tmp.AllocateFilename("txt");
151-
var evt = Some.LogEvent("Irelevant as it will be replaced by the formatter ");
151+
var evt = Some.LogEvent("Irrelevant as it will be replaced by the formatter");
152152
var actualEventOutput = "x";
153153
var formatter = new FixedOutputFormatter(actualEventOutput);
154154
var eventOuputLength = encoding.GetByteCount(actualEventOutput);

test/Serilog.Sinks.File.Tests/FixedOutputFormatter.cs renamed to test/Serilog.Sinks.File.Tests/Support/FixedOutputFormatter.cs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
using Serilog.Formatting;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Threading.Tasks;
62
using Serilog.Events;
73
using System.IO;
84

9-
namespace Serilog.Tests
5+
namespace Serilog.Tests.Support
106
{
117
public class FixedOutputFormatter : ITextFormatter
128
{

0 commit comments

Comments
 (0)