C# 클래스 JSNLog.Infrastructure.LevelUtils

파일 보기 프로젝트 열기: mperdeck/jsnlog

공개 메소드들

메소드 설명
HighestLevel ( ) : Level

Returns the highest level as given in Level enum.

IntToLevel ( int i ) : Level

Converts a number to a level. Each level is associated with a value. If the number is equal to or lower than a level, but higher than the previous level, than that level is used. So if: TRACE = 1000, DEBUG = 2000, INFO = 3000, WARN = 4000, ERROR = 5000, FATAL = 6000 And the number is: 2500, than this method returns INFO. If the number is greater than FATAL (highest level), than FATAL is returned. If the number is lower than TRACE, than TRACE is returned. This method assumes that the Level enum is sorted by value!

LevelNumber ( string level ) : int

Determines the numeric value of a level. If level is a number, returns the number. If level is a predefined level name, returns number corresponding to that level. Otherwise throws exception.

NamedLevels ( ) : string

Returns a string with all named levels, separated by | This is used by the web site project.

ParseLevel ( string levelString ) : Level?

Parses a string with the name or value of a level.

PredefinedName ( string level ) : string

Returns the friendly name of the given level if possible. If level is a number matching one of the predefined levels, that level's name is returned. Otherwise, level is returned.

ValidateLevel ( string level ) : void

Throws exception if level is not a valid level.

메소드 상세

HighestLevel() 공개 정적인 메소드

Returns the highest level as given in Level enum.
public static HighestLevel ( ) : Level
리턴 Level

IntToLevel() 공개 정적인 메소드

Converts a number to a level. Each level is associated with a value. If the number is equal to or lower than a level, but higher than the previous level, than that level is used. So if: TRACE = 1000, DEBUG = 2000, INFO = 3000, WARN = 4000, ERROR = 5000, FATAL = 6000 And the number is: 2500, than this method returns INFO. If the number is greater than FATAL (highest level), than FATAL is returned. If the number is lower than TRACE, than TRACE is returned. This method assumes that the Level enum is sorted by value!
public static IntToLevel ( int i ) : Level
i int
리턴 Level

LevelNumber() 공개 정적인 메소드

Determines the numeric value of a level. If level is a number, returns the number. If level is a predefined level name, returns number corresponding to that level. Otherwise throws exception.
public static LevelNumber ( string level ) : int
level string
리턴 int

NamedLevels() 공개 정적인 메소드

Returns a string with all named levels, separated by | This is used by the web site project.
public static NamedLevels ( ) : string
리턴 string

ParseLevel() 공개 정적인 메소드

Parses a string with the name or value of a level.
public static ParseLevel ( string levelString ) : Level?
levelString string
리턴 Level?

PredefinedName() 공개 정적인 메소드

Returns the friendly name of the given level if possible. If level is a number matching one of the predefined levels, that level's name is returned. Otherwise, level is returned.
public static PredefinedName ( string level ) : string
level string
리턴 string

ValidateLevel() 공개 정적인 메소드

Throws exception if level is not a valid level.
public static ValidateLevel ( string level ) : void
level string
리턴 void