<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def level_from_name(self, level_name):
 """Return the level constant for a given name. If the *level_name* is not known, raise a ValueError. Parameters level_name : str The logging level name whose logging level constant to retrieve. Returns ------- level : logging level constant The logging level constant associated with the name. """

        try:
            return self.LEVELS.index(level_name)
        except ValueError:
            raise ValueError("Unknown logging level name '%s'" % (level_name,))