Github user chtyim commented on a diff in the pull request: https://github.com/apache/twill/pull/14#discussion_r91844855 --- Diff: twill-yarn/src/main/java/org/apache/twill/yarn/YarnTwillPreparer.java --- @@ -384,6 +408,24 @@ private void setEnv(String runnableName, Map<String, String> env, boolean overwr } } + private void saveLogLevels(LogEntry.Level level) { + level = level == null ? LogEntry.Level.INFO : level; + Map<String, String> appLogLevels = new HashMap<>(); + appLogLevels.put(Logger.ROOT_LOGGER_NAME, level.name()); + for (String runnableName : twillSpec.getRunnables().keySet()) { + this.logLevels.put(runnableName, appLogLevels); + } + } + + private void saveLogLevels(String runnableName, Map<String, LogEntry.Level> logLevels) { + Map<String, String> newLevels = new HashMap<>(); + for (Map.Entry<String, LogEntry.Level> entry : logLevels.entrySet()) { + Preconditions.checkArgument(entry.getValue() != null, "Log level cannot be null for logger {}", entry.getKey()); + newLevels.put(entry.getKey(), entry.getValue().name()); + } + this.logLevels.get(runnableName).putAll(newLevels); --- End diff -- We should always create a new map instead of calling `putAll`. The reason is the exposed method is call `setLogLevels`, not `addLogLevels` or `appendLogLevels`, which implies a overwriting instead of appending.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---