LogLevel
This class defines a command-line interface option for selecting a logging level from a predefined set of choices. It extends the standard choice functionality to support case-insensitive input and converts string labels into their corresponding numeric logging values.
Constructor
Signature
def LogLevel() - > null
Signature
def LogLevel() - > null
Methods
convert()
@classmethod
def convert(
value: string|int,
param: click.Parameter,
ctx: click.Context
) - > int
Converts the input value into a numeric logging level. This method handles both integer inputs and string labels, normalizing strings to uppercase before mapping them to their internal logging level representation.
Parameters
| Name | Type | Description |
|---|---|---|
| value | `string | int` |
| param | click.Parameter | The Click parameter object that this value is being associated with during parsing. |
| ctx | click.Context | The current Click execution context used for error handling and state management. |
Returns
| Type | Description |
|---|---|
int | The numeric logging level corresponding to the input value, as resolved by the mlevel mapping function. |