code: function getLevel(nameOrValue) {
    // DEBUG is not a predefined Closure log level, but maps to CONFIG. Since
    // DEBUG is a predefined level for the WebDriver protocol, we prefer it over
    // CONFIG.
    if ('DEBUG' === nameOrValue || Logger.Level.DEBUG.value === nameOrValue) {
      return Logger.Level.DEBUG;
    } else if (goog.isString(nameOrValue)) {
      return Logger.Level.getPredefinedLevel(/** @type {string} */(nameOrValue))
          || Logger.Level.ALL;
    } else {
      return Logger.Level.getPredefinedLevelByValue(
          /** @type {number} */(nameOrValue)) || Logger.Level.ALL;
    }
  }
docs: Converts a level name or value to a {@link webdriver.logging.Level} value.
  If the name/value is not recognized, {@link webdriver.logging.Level.ALL}
  will be returned.
  @param {(number|string)} nameOrValue The log level name, or value, to
  convert .
  @return {!Logger.Level} The converted level.