Updated
This commit is contained in:
@@ -12,7 +12,7 @@ namespace EonaCat.Logger.EonaCatCoreLogger.Internal
|
||||
// This file is part of the EonaCat project(s) which is released under the Apache License.
|
||||
// See the LICENSE file or go to https://EonaCat.com/License for full license details.
|
||||
|
||||
public abstract class BatchingLoggerProvider : ILoggerProvider
|
||||
public abstract class BatchingLoggerProvider : ILoggerProvider, IDisposable
|
||||
{
|
||||
protected DateTimeOffset CurrentDateTimeOffset => UseLocalTime ? DateTimeOffset.Now : DateTimeOffset.UtcNow;
|
||||
protected DateTime CurrentDateTme => UseLocalTime ? DateTime.Now : DateTime.UtcNow;
|
||||
@@ -144,9 +144,13 @@ namespace EonaCat.Logger.EonaCatCoreLogger.Internal
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
#pragma warning disable CS4014
|
||||
StopAsync();
|
||||
#pragma warning restore CS4014
|
||||
while (!_messageQueue.IsEmpty)
|
||||
{
|
||||
_messageQueue.TryDequeue(out _);
|
||||
}
|
||||
|
||||
StopAsync().GetAwaiter().GetResult();
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user