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 logging level to check against the current logger configuration. |
Returns
| Type | Description |
|---|---|
bool | True if logs at the specified level will be written, False otherwise. |