File tree Expand file tree Collapse file tree 1 file changed +21
-14
lines changed Expand file tree Collapse file tree 1 file changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -325,22 +325,29 @@ private bool ParseData(string data)
325325 /// <returns>The mapped <see cref="LogLevel"/>.</returns>
326326 private LogLevel MapLevelType ( string levelType )
327327 {
328- if ( ! string . IsNullOrEmpty ( levelType ) )
328+ if ( ! string . IsNullOrEmpty ( levelType ) )
329329 {
330- switch ( levelType . ToUpper ( ) )
330+ var level = levelType ;
331+ if ( Settings . Default . LevelTRACE . Split ( ';' ) . Any ( x=> String . Equals ( x , level , StringComparison . CurrentCultureIgnoreCase ) ) )
331332 {
332- case "TRACE" :
333- return LogLevel . Trace ;
334- case "DEBUG" :
335- return LogLevel . Debug ;
336- case "INFO" :
337- return LogLevel . Info ;
338- case "WARN" :
339- return LogLevel . Warning ;
340- case "ERROR" :
341- return LogLevel . Error ;
342- case "FATAL" :
343- return LogLevel . Fatal ;
333+ return LogLevel . Trace ;
334+ }
335+ else if ( Settings . Default . LevelDEBUG . Split ( ';' ) . Any ( x => String . Equals ( x , level , StringComparison . CurrentCultureIgnoreCase ) ) )
336+
337+ {
338+ return LogLevel . Debug ;
339+ }
340+ else if ( Settings . Default . LevelINFO . Split ( ';' ) . Any ( x => String . Equals ( x , level , StringComparison . CurrentCultureIgnoreCase ) ) )
341+ {
342+ return LogLevel . Info ;
343+ }
344+ else if ( Settings . Default . LevelWARN . Split ( ';' ) . Any ( x => String . Equals ( x , level , StringComparison . CurrentCultureIgnoreCase ) ) )
345+ {
346+ return LogLevel . Warning ;
347+ }
348+ else if ( Settings . Default . LevelFATAL . Split ( ';' ) . Any ( x => String . Equals ( x , level , StringComparison . CurrentCultureIgnoreCase ) ) )
349+ {
350+ return LogLevel . Fatal ;
344351 }
345352 }
346353
You can’t perform that action at this time.
0 commit comments