code: func LevelFromString(str string) (LogLevel, error) {
  	switch strings.ToLower(str) {
  	case "crit", "critical":
  		return Critical, nil
  	case "err", "error":
  		return Error, nil
  	case "warn", "warning":
  		return Warning, nil
  	case "note", "notice":
  		return Notice, nil
  	case "info":
  		return Info, nil
  	case "debug":
  		return Debug, nil
  	case "trace":
  		return Trace, nil
  	}
  	val, err := strconv.ParseInt(str, 10, 32)
  	if err == nil {
  		return LogLevel(val), nil
  	}
  	return 0, fmt.Errorf("Invalid log level: %s", str)
  }
docs: // LevelFromString will convert a named log level to its corresponding value
  // type, or error if both the name was unknown and an integer value was unable
  // to be parsed.