Github user yaojiefeng commented on a diff in the pull request:

    https://github.com/apache/twill/pull/14#discussion_r91845583
  
    --- 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 --
    
    Will this make the `setLogLevels` complicated for the user? For example, if 
user wants to change several log levels for the entire application. He also 
wants to set a particular logger for the runnable. He will have to have to pass 
in the entire map to `setLogLevels(runnableName, logLevelsMap)`. Is it good to 
do so?


---
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.
---

Reply via email to