diff --git a/cpp/src/phonenumbers/phonenumberutil.cc b/cpp/src/phonenumbers/phonenumberutil.cc index ffa7da18f..d8f72b5c2 100644 --- a/cpp/src/phonenumbers/phonenumberutil.cc +++ b/cpp/src/phonenumbers/phonenumberutil.cc @@ -1061,9 +1061,8 @@ void PhoneNumberUtil::FormatOutOfCountryCallingNumber( string* formatted_number) const { DCHECK(formatted_number); if (!IsValidRegionCode(calling_from)) { - LOG(WARNING) << "Trying to format number from invalid region " - << calling_from - << ". International formatting applied."; + VLOG(1) << "Trying to format number from invalid region " << calling_from + << ". International formatting applied."; Format(number, INTERNATIONAL, formatted_number); return; } @@ -1377,9 +1376,10 @@ void PhoneNumberUtil::FormatOutOfCountryKeepingAlphaChars( // Invalid region entered as country-calling-from (so no metadata was found // for it) or the region chosen has multiple international dialling // prefixes. - LOG(WARNING) << "Trying to format number from invalid region " - << calling_from - << ". International formatting applied."; + if (!IsValidRegionCode(calling_from)) { + VLOG(1) << "Trying to format number from invalid region " << calling_from + << ". International formatting applied."; + } formatted_number->assign(raw_input_copy); PrefixNumberWithCountryCallingCode(country_code, INTERNATIONAL, formatted_number); diff --git a/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java b/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java index 1882217ea..14be7f09e 100644 --- a/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java +++ b/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java @@ -1639,10 +1639,12 @@ public class PhoneNumberUtil { } else { // Invalid region entered as country-calling-from (so no metadata was found for it) or the // region chosen has multiple international dialling prefixes. - logger.log(Level.WARNING, - "Trying to format number from invalid region " - + regionCallingFrom - + ". International formatting applied."); + if (!isValidRegionCode(regionCallingFrom)) { + logger.log(Level.WARNING, + "Trying to format number from invalid region " + + regionCallingFrom + + ". International formatting applied."); + } prefixNumberWithCountryCallingCode(countryCode, PhoneNumberFormat.INTERNATIONAL, formattedNumber); diff --git a/tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar b/tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar index 6e0b5bcbc..fc40b63f7 100644 Binary files a/tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar and b/tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar differ diff --git a/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar b/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar index b0fe6761a..961e57452 100644 Binary files a/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar and b/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar differ