ConfigurationConsoleLoggerSettings.TryGetSwitch(String, LogLevel) 方法

定义

获取指定开关的日志级别。

public:
 virtual bool TryGetSwitch(System::String ^ name, [Runtime::InteropServices::Out] Microsoft::Extensions::Logging::LogLevel % level);
public bool TryGetSwitch (string name, out Microsoft.Extensions.Logging.LogLevel level);
abstract member TryGetSwitch : string * LogLevel -> bool
override this.TryGetSwitch : string * LogLevel -> bool
Public Function TryGetSwitch (name As String, ByRef level As LogLevel) As Boolean

参数

name
String

要查找的开关的名称。

level
LogLevel

此方法返回时,包含开关的值(如果找到)。 如果未找到开关,则此参数设置为 None

返回

true 如果找到开关,则为 ;否则为 false

实现

例外

适用于