Skip to main content

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

NameTypeDescription
value`stringint`
paramclick.ParameterThe Click parameter object that this value is being associated with during parsing.
ctxclick.ContextThe current Click execution context used for error handling and state management.

Returns

TypeDescription
intThe numeric logging level corresponding to the input value, as resolved by the mlevel mapping function.