-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fall back to IDisposable in Log.CloseAndFlushAsync() when the target …
…logger is not IAsyncDisposable
- Loading branch information
1 parent
68881e1
commit b5085aa
Showing
4 changed files
with
37 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#nullable enable | ||
|
||
namespace Serilog.Tests.Support; | ||
|
||
public class DisposableLogger : ILogger, IDisposable | ||
|
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,19 @@ | ||
#if FEATURE_ASYNCDISPOSABLE && FEATURE_DEFAULT_INTERFACE | ||
|
||
namespace Serilog.Tests.Support; | ||
|
||
public class SyncDisposableLogger: ILogger, IDisposable | ||
{ | ||
public bool IsDisposed { get; private set; } | ||
|
||
public void Write(LogEvent logEvent) | ||
{ | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
IsDisposed = true; | ||
} | ||
} | ||
|
||
#endif |