code: def level_to_number(value):
      
      if is_string(value):
          try:
              defined_levels = find_defined_levels()
              value = defined_levels[value.upper()]
          except KeyError:
              # Don't fail on unsupported log levels.
              value = DEFAULT_LOG_LEVEL
      return value
docs: Coerce a logging level name to a number.
  
      :param value: A logging level (integer or string).
      :returns: The number of the log level (an integer).
  
      This function translates log level names into their numeric values. The
      :mod:`logging` module does this for us on Python 2.7 and 3.4 but fails to
      do so on Python 2.6 which :mod:`coloredlogs` still supports.