View Javadoc
1   package ch.qos.logback.classic.spi;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   
6   import ch.qos.logback.classic.Level;
7   import ch.qos.logback.classic.Logger;
8   import ch.qos.logback.classic.LoggerContext;
9   import ch.qos.logback.classic.spi.BasicContextListener.UpdateType;
10  
11  public class ListContextListener implements LoggerContextListener {
12  
13      List<BasicContextListener.UpdateType> updateList = new ArrayList<>();
14  
15      @Override
16      public boolean isResetResistant() {
17          return false;
18      }
19  
20      @Override
21      public void onStart(LoggerContext context) {
22          updateList.add(UpdateType.START);
23      }
24  
25      @Override
26      public void onReset(LoggerContext context) {
27          updateList.add(UpdateType.RESET);
28      }
29  
30      @Override
31      public void onStop(LoggerContext context) {
32          updateList.add(UpdateType.STOP);
33  
34      }
35  
36      @Override
37      public void onLevelChange(Logger logger, Level level) {
38          updateList.add(UpdateType.LEVEL_CHANGE);
39      }
40  
41  }