-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from serilog/dev
5.0.0 Release
- Loading branch information
Showing
7 changed files
with
117 additions
and
462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 0 additions & 88 deletions
88
src/Serilog.Sinks.PeriodicBatching/Sinks/PeriodicBatching/FailureAwareBatchScheduler.cs
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
src/Serilog.Sinks.PeriodicBatching/Sinks/PeriodicBatching/LegacyBatchedSinkAdapter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using Serilog.Events; | ||
|
||
namespace Serilog.Sinks.PeriodicBatching; | ||
|
||
sealed class LegacyBatchedSinkAdapter: Core.IBatchedLogEventSink, IDisposable | ||
#if FEATURE_ASYNCDISPOSABLE | ||
, IAsyncDisposable | ||
#endif | ||
{ | ||
readonly IBatchedLogEventSink _inner; | ||
readonly bool _dispose; | ||
|
||
public LegacyBatchedSinkAdapter(IBatchedLogEventSink inner, bool dispose) | ||
{ | ||
_inner = inner; | ||
_dispose = dispose; | ||
} | ||
|
||
public Task EmitBatchAsync(IReadOnlyCollection<LogEvent> batch) | ||
{ | ||
return _inner.EmitBatchAsync(batch); | ||
} | ||
|
||
public Task OnEmptyBatchAsync() | ||
{ | ||
return _inner.OnEmptyBatchAsync(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
if (!_dispose) | ||
return; | ||
|
||
(_inner as IDisposable)?.Dispose(); | ||
} | ||
|
||
#if FEATURE_ASYNCDISPOSABLE | ||
public async ValueTask DisposeAsync() | ||
{ | ||
if (!_dispose) | ||
return; | ||
|
||
if (_inner is IAsyncDisposable asyncDisposable) | ||
{ | ||
await asyncDisposable.DisposeAsync(); | ||
} | ||
else | ||
{ | ||
Dispose(); | ||
} | ||
} | ||
#endif | ||
} |
Oops, something went wrong.