C# Класс JSNLog.Infrastructure.LevelUtils

Показать файл Открыть проект

Открытые методы

Метод Описание
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