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

    https://github.com/apache/twill/pull/14#discussion_r90767247
  
    --- Diff: 
twill-yarn/src/main/java/org/apache/twill/internal/container/TwillContainerService.java
 ---
    @@ -51,29 +63,36 @@
       private final ClassLoader classLoader;
       private final BasicTwillContext context;
       private final ContainerLiveNodeData containerLiveNodeData;
    +  private final Map<String, LogEntry.Level> oldLogLevels;
    +  private final Map<String, LogEntry.Level> defaultLogLevels;
       private ExecutorService commandExecutor;
       private TwillRunnable runnable;
     
       public TwillContainerService(BasicTwillContext context, ContainerInfo 
containerInfo, ZKClient zkClient,
                                    RunId runId, TwillRunnableSpecification 
specification, ClassLoader classLoader,
    -                               Location applicationLocation) {
    +                               Location applicationLocation, Map<String, 
LogEntry.Level> defaultLogLevels,
    +                               Map<String, LogEntry.Level> logLevels) {
         super(zkClient, runId, applicationLocation);
     
         this.specification = specification;
         this.classLoader = classLoader;
    -    this.containerLiveNodeData = createLiveNodeData(containerInfo);
    +    this.defaultLogLevels = ImmutableMap.copyOf(defaultLogLevels);
    +    this.oldLogLevels = Collections.synchronizedMap(new 
HashMap<>(defaultLogLevels));
    --- End diff --
    
    can you explain what oldLogLevels is for? My understanding is this:
    - when a log level is updated, you save previous level in oldLogLevels
    - when the log level is reset, you restore the log level from oldLogLevels
    Is that correct?
    
    If so, then consider this scenario:
    - root log level is INFO
    - I debug a problem, so I set the root log level to DEBUG
    - I set the log level for one logger to TRACE
    - now I found the problem. 
    - I reset the log level for that particular logger
    - then I set the root log level back to INFO
    
    what will be the log level for that particular logger after all this? INFO 
or DEBUG?


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