IsEnabled Method
IsEnabled(LogLevel)
Checks whether the given logLevel
has been enabled by the log provider.
C#
[Obsolete("Obsolete, use equivalent ILogger method, or view the changelog for further instruction.")]
public bool IsEnabled(LogLevel logLevel)
Parameters
Type | Name | Description |
---|---|---|
LogLevel | logLevel | The log level you wish to check. |
Returns
bool
true
if enabled; false
otherwise.
Implements
Remarks
Sometimes you may wish to run additional code to gather extra diagnostics for your log. But, since this is extra work, you likely don't want to always run this code. You only want to run it when you know there is a log provider ready to consume it. You can use this method to first test to see if this log level is enabled before running the extra diagnostics code.