function getVersionStringForLogging(browser) {
  if (useUserAgentDataBrand(true)) {
    const fullVersionObj = fullVersionOf(browser);
    if (fullVersionObj) {
      const fullVersion = fullVersionObj.getIfLoaded();
      if (fullVersion) {
        return fullVersion.toVersionStringForLogging();
      }
      // No full version, return the major version instead.
      const data = util.getUserAgentData();
      const matchingBrand = data.brands.find(({brand}) => brand === browser);
      // Checking for the existence of matchingBrand is not necessary because
      // the existence of fullVersionObj implies that there is already a
      // matching brand.
      assertExists(matchingBrand);
      return matchingBrand.version;
    }
    // If fullVersionObj is undefined, this doesn't mean that the full version
    // is unavailable, but rather that the current browser doesn't match the
    // input `browser` argument.
    return '';
  } else {
    return getFullVersionFromUserAgentString(browser);
  }
}
Returns a version string for the current browser or undefined, based on
whether the current browser is the one specified.
This value should ONLY be used for logging/debugging purposes. Do not use it
to branch code paths. For comparing versions, use isAtLeast()/isAtMost() or
fullVersionOf() instead.
@param {!AllBrandsInternal} browser The brand whose version should be
    returned.
@return {string} The version as a string.