code: function getLevel(nameOrValue) {
    if (typeof nameOrValue === 'string') {
      return LEVELS_BY_NAME.get(nameOrValue) || Level.ALL;
    }
    if (typeof nameOrValue !== 'number') {
      throw new TypeError('not a string or number');
    }
    for (let level of ALL_LEVELS) {
      if (nameOrValue >= level.value) {
        return level;
      }
    }
    return Level.ALL;
  }
docs: Converts a level name or value to a {@link Level} value. If the name/value
  is not recognized, {@link Level.ALL} will be returned.
  
  @param {(number|string)} nameOrValue The log level name, or value, to
  convert.
  @return {!Level} The converted level.