Commit 8d03724 1 parent 3a1c58f commit 8d03724 Copy full SHA for 8d03724
File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public GetChocolatey()
106
106
/// <returns>This <see cref="GetChocolatey"/> instance</returns>
107
107
public GetChocolatey SetCustomLogging ( ILog logger )
108
108
{
109
- Log . InitializeWith ( logger ) ;
109
+ Log . InitializeWith ( logger , resetLoggers : false ) ;
110
110
return this ;
111
111
}
112
112
Original file line number Diff line number Diff line change @@ -31,22 +31,24 @@ public static class Log
31
31
/// Sets up logging to be with a certain type
32
32
/// </summary>
33
33
/// <typeparam name="T">The type of ILog for the application to use</typeparam>
34
- public static void InitializeWith < T > ( ) where T : ILog , new ( )
34
+ /// <param name="resetLoggers">Should other loggers be reset?</param>
35
+ public static void InitializeWith < T > ( bool resetLoggers = true ) where T : ILog , new ( )
35
36
{
36
37
_logType = typeof ( T ) ;
37
- LogExtensions . ResetLoggers ( ) ;
38
+ if ( resetLoggers ) LogExtensions . ResetLoggers ( ) ;
38
39
}
39
40
40
41
/// <summary>
41
42
/// Sets up logging to be with a certain instance. The other method is preferred.
42
43
/// </summary>
43
44
/// <param name="loggerType">Type of the logger.</param>
45
+ /// <param name="resetLoggers">Should other loggers be reset?</param>
44
46
/// <remarks>This is mostly geared towards testing</remarks>
45
- public static void InitializeWith ( ILog loggerType )
47
+ public static void InitializeWith ( ILog loggerType , bool resetLoggers = true )
46
48
{
47
49
_logType = loggerType . GetType ( ) ;
48
50
_logger = loggerType ;
49
- LogExtensions . ResetLoggers ( ) ;
51
+ if ( resetLoggers ) LogExtensions . ResetLoggers ( ) ;
50
52
}
51
53
52
54
/// <summary>
You can’t perform that action at this time.
0 commit comments