Skip to content

Commit 5b3d64a

Browse files
committed
OnOpened() -> OnFileOpened()
1 parent ca0ac8c commit 5b3d64a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Serilog.Sinks.File/Sinks/File/FileLifecycleHooks.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public abstract class FileLifecycleHooks
3434
/// <param name="underlyingStream">The underlying <see cref="Stream"/> opened on the log file.</param>
3535
/// <param name="encoding">The encoding to use when reading/writing to the stream.</param>
3636
/// <returns>The <see cref="Stream"/> Serilog should use when writing events to the log file.</returns>
37-
public virtual Stream OnOpened(Stream underlyingStream, Encoding encoding) => underlyingStream;
37+
public virtual Stream OnFileOpened(Stream underlyingStream, Encoding encoding) => underlyingStream;
3838
}
3939
}

src/Serilog.Sinks.File/Sinks/File/FileSink.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ internal FileSink(
8383

8484
if (hooks != null)
8585
{
86-
outputStream = hooks.OnOpened(outputStream, encoding) ??
87-
throw new InvalidOperationException($"The file lifecycle hook `{nameof(FileLifecycleHooks.OnOpened)}(...)` returned `null`.");
86+
outputStream = hooks.OnFileOpened(outputStream, encoding) ??
87+
throw new InvalidOperationException($"The file lifecycle hook `{nameof(FileLifecycleHooks.OnFileOpened)}(...)` returned `null`.");
8888
}
8989

9090
_output = new StreamWriter(outputStream, encoding);

test/Serilog.Sinks.File.Tests/Support/FileHeaderWriter.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public FileHeaderWriter(string header)
1212
Header = header;
1313
}
1414

15-
public override Stream OnOpened(Stream underlyingStream, Encoding encoding)
15+
public override Stream OnFileOpened(Stream underlyingStream, Encoding encoding)
1616
{
1717
if (underlyingStream.Length == 0)
1818
{
@@ -22,7 +22,7 @@ public override Stream OnOpened(Stream underlyingStream, Encoding encoding)
2222
underlyingStream.Flush();
2323
}
2424

25-
return base.OnOpened(underlyingStream, encoding);
25+
return base.OnFileOpened(underlyingStream, encoding);
2626
}
2727
}
2828
}

test/Serilog.Sinks.File.Tests/Support/GZipHooks.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public GZipHooks(int bufferSize = 1024 * 32)
1717
_bufferSize = bufferSize;
1818
}
1919

20-
public override Stream OnOpened(Stream underlyingStream, Encoding _)
20+
public override Stream OnFileOpened(Stream underlyingStream, Encoding _)
2121
{
2222
var compressStream = new GZipStream(underlyingStream, CompressionMode.Compress);
2323
return new BufferedStream(compressStream, _bufferSize);

0 commit comments

Comments
 (0)