LogLevelConverter

Helper class used to convert log level values.

Description

The LogLevelConverter class is used to convert log level values.

Static methods

ToInteger

Converts a log level to a number.

public static int ToInteger([LogLevel](../log_level level))

  • level: LogLevel - log level to convert.
  • returns: int - log level number value.

ToLogLevel

Converts numbers and strings to standard log level values.

public static LogLevel ToLogLevel(object value, LogLevel defaultValue = LogLevel.Info)

  • value: object - value to be converted
  • defaultValue: LogLevel - default value if conversion is not possible
  • returns: LogLevel - converted log level

ToString

Converts a log level to a string.

public static string ToString(LogLevel level)

  • level: LogLevel - log level to convert
  • returns: string - log level name.

See also