@@ -65,26 +65,26 @@ public void ShouldRespectDynamicLevelChanges()
6565 logger . ForContext ( Constants . SourceContextPropertyName , "Root.Test" ) . Write ( Some . DebugEvent ( ) ) ;
6666 Assert . Single ( DummyConsoleSink . Emitted ) ;
6767 }
68+ }
6869
69- void UpdateConfig ( LogEventLevel ? minimumLevel = null , LogEventLevel ? switchLevel = null , LogEventLevel ? overrideLevel = null )
70+ void UpdateConfig ( LogEventLevel ? minimumLevel = null , LogEventLevel ? switchLevel = null , LogEventLevel ? overrideLevel = null )
71+ {
72+ if ( minimumLevel . HasValue )
7073 {
71- if ( minimumLevel . HasValue )
72- {
73- _configSource . Set ( "Serilog:MinimumLevel:Default" , minimumLevel . Value . ToString ( ) ) ;
74- }
75-
76- if ( switchLevel . HasValue )
77- {
78- _configSource . Set ( "Serilog:LevelSwitches:$mySwitch" , switchLevel . Value . ToString ( ) ) ;
79- }
74+ _configSource . Set ( "Serilog:MinimumLevel:Default" , minimumLevel . Value . ToString ( ) ) ;
75+ }
8076
81- if ( overrideLevel . HasValue )
82- {
83- _configSource . Set ( "Serilog:MinimumLevel:Override:Root.Test " , overrideLevel . Value . ToString ( ) ) ;
84- }
77+ if ( switchLevel . HasValue )
78+ {
79+ _configSource . Set ( "Serilog:LevelSwitches:$mySwitch " , switchLevel . Value . ToString ( ) ) ;
80+ }
8581
86- _configSource . Reload ( ) ;
82+ if ( overrideLevel . HasValue )
83+ {
84+ _configSource . Set ( "Serilog:MinimumLevel:Override:Root.Test" , overrideLevel . Value . ToString ( ) ) ;
8785 }
86+
87+ _configSource . Reload ( ) ;
8888 }
8989 }
9090}
0 commit comments