IsLoggable
Gets a value indicating whether logs at this level will be written to the logger. This is particularly useful to avoid computing log messages unnecessarily.
def IsLoggable(
context: context.Context,
level: Level
) - > bool
Gets a value indicating whether logs at this level will be written to the logger. This is particularly useful to avoid computing log messages unnecessarily.
Parameters
| Name | Type | Description |
|---|---|---|
| context | context.Context | The context for the log operation, typically used for tracing or cancellation. |
| level | Level | The log level to check for loggability. |
Returns
| Type | Description |
|---|---|
bool | A boolean indicating if the specified log level is currently loggable. |