File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Sources/Falko.ZeroLogger.Microsoft.Logging Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 33
44namespace System . Logging . Factories ;
55
6- public sealed class MicrosoftLoggerFactory : IMicrosoftLoggerFactory
6+ internal sealed class MicrosoftLoggerFactory : IMicrosoftLoggerFactory
77{
88 private readonly ConcurrentDictionary < string , IMicrosoftLogger > _loggers = new ( StringComparer . Ordinal ) ;
99
@@ -33,6 +33,6 @@ public void AddProvider(IMicrosoftLoggerProvider provider) { }
3333
3434 public void Dispose ( )
3535 {
36- _loggerRuntime . Dispose ( ) ;
36+ if ( _disposeLoggerRuntime ) _loggerRuntime . Dispose ( ) ;
3737 }
3838}
Original file line number Diff line number Diff line change 1+ using System . Logging . Factories ;
12using System . Logging . Providers ;
23
34namespace System . Logging . Runtimes ;
@@ -15,4 +16,16 @@ public static IMicrosoftLoggerProvider ToMicrosoftLoggerProvider
1516
1617 return new MicrosoftLoggerProvider ( loggerRuntime , forceDispose ) ;
1718 }
19+
20+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
21+ public static IMicrosoftLoggerFactory ToMicrosoftLoggerFactory
22+ (
23+ this LoggerRuntime loggerRuntime ,
24+ bool forceDispose = true
25+ )
26+ {
27+ ArgumentNullException . ThrowIfNull ( loggerRuntime ) ;
28+
29+ return new MicrosoftLoggerFactory ( loggerRuntime , forceDispose ) ;
30+ }
1831}
You can’t perform that action at this time.
0 commit comments