diff --git a/src/main/java/org/meeuw/i18n/languages/ISO_639.java b/src/main/java/org/meeuw/i18n/languages/ISO_639.java index 50a2443..2e1acfe 100644 --- a/src/main/java/org/meeuw/i18n/languages/ISO_639.java +++ b/src/main/java/org/meeuw/i18n/languages/ISO_639.java @@ -1,6 +1,7 @@ package org.meeuw.i18n.languages; import java.util.*; +import java.util.logging.Level; import java.util.stream.Stream; import javax.validation.constraints.Size; @@ -76,7 +77,7 @@ public static Optional getByPart2T(String code) { */ public static Optional getByPart3(@Size(min = 3, max = 3) String code, boolean matchRetired) { - return ISO_639_3_Code.getByPart3(code, matchRetired) + return ISO_639_3_Code.getByPart3(code, matchRetired, Level.WARNING) .map(LanguageCode::updateToEnum) ; } diff --git a/src/main/java/org/meeuw/i18n/languages/ISO_639_3_Code.java b/src/main/java/org/meeuw/i18n/languages/ISO_639_3_Code.java index 657ea8a..de6676c 100644 --- a/src/main/java/org/meeuw/i18n/languages/ISO_639_3_Code.java +++ b/src/main/java/org/meeuw/i18n/languages/ISO_639_3_Code.java @@ -1,8 +1,5 @@ package org.meeuw.i18n.languages; -import com.fasterxml.jackson.annotation.JsonValue; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; import java.io.*; import java.nio.charset.StandardCharsets; import java.util.*; @@ -10,6 +7,11 @@ import java.util.logging.Logger; import java.util.stream.Stream; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +import com.fasterxml.jackson.annotation.JsonValue; + /** * Implementation of {@link LanguageCode} that {@link ISO_639#stream() produces} all ISO-639-3 codes. *

@@ -86,12 +88,12 @@ public class ISO_639_3_Code implements LanguageCode { String[] split = line.split("\t"); ISO_639_3_Code macro = KNOWN.get(split[0]); List list = tempIndividual.computeIfAbsent(macro, (m) -> new ArrayList<>()); - Optional individual = getByPart3(split[1], true); + Optional individual = getByPart3(split[1], true, Level.FINEST); if (individual.isPresent()) { list.add(LanguageCode.updateToEnum(individual.get())); tempMacro.computeIfAbsent(individual.get(), (m) -> new ArrayList<>()).add(LanguageCode.updateToEnum(macro)); } else { - System.out.println("Unknown individual language: " + split[1] + " for " + macro); + LOGGER.log(Level.FINEST, "Unknown individual language: " + split[1] + " for " + macro); } line = inputStreamReader.readLine(); } @@ -150,7 +152,7 @@ static Optional getByPart1(String code) { * @return An optional containing the {@link ISO_639_3_Code} if found. * @since 2.2 */ - static Optional getByPart3(@Size(min = 3, max=3) String code, boolean matchRetired) { + static Optional getByPart3(@Size(min = 3, max=3) String code, boolean matchRetired, Level level) { if (code == null) { return Optional.empty(); } @@ -161,7 +163,7 @@ static Optional getByPart3(@Size(min = 3, max=3) String code, bo try { prop = KNOWN.get(retiredLanguageCode.get().changeTo().part3()); } catch (RetiredLanguageCode.RetirementException e) { - LOGGER.log(Level.WARNING, "Could not find single replacement for " + code + " " + e.getMessage()); + LOGGER.log(level, "Could not find single replacement for " + code + " " + e.getMessage()); } } }