View Javadoc
1   package org.slf4j.event;
2   
3   import java.util.ArrayList;
4   import java.util.Arrays;
5   import java.util.List;
6   
7   import org.slf4j.Marker;
8   import org.slf4j.helpers.SubstituteLogger;
9   
10  public class SubstituteLoggingEvent implements LoggingEvent {
11  
12      Level level;
13      List<Marker> markers;
14      String loggerName;
15      SubstituteLogger logger;
16      String threadName;
17      String message;
18      Object[] argArray;
19      List<KeyValuePair> keyValuePairList;
20  
21      long timeStamp;
22      Throwable throwable;
23  
24      public Level getLevel() {
25          return level;
26      }
27  
28      public void setLevel(Level level) {
29          this.level = level;
30      }
31  
32      public List<Marker> getMarkers() {
33          return markers;
34      }
35  
36      public void addMarker(Marker marker) {
37          if (marker == null)
38              return;
39  
40          if (markers == null) {
41              markers = new ArrayList<>(2);
42          }
43  
44          markers.add(marker);
45      }
46  
47      public String getLoggerName() {
48          return loggerName;
49      }
50  
51      public void setLoggerName(String loggerName) {
52          this.loggerName = loggerName;
53      }
54  
55      public SubstituteLogger getLogger() {
56          return logger;
57      }
58  
59      public void setLogger(SubstituteLogger logger) {
60          this.logger = logger;
61      }
62  
63      public String getMessage() {
64          return message;
65      }
66  
67      public void setMessage(String message) {
68          this.message = message;
69      }
70  
71      public Object[] getArgumentArray() {
72          return argArray;
73      }
74  
75      public void setArgumentArray(Object[] argArray) {
76          this.argArray = argArray;
77      }
78  
79      @Override
80      public List<Object> getArguments() {
81          if (argArray == null) {
82              return null;
83          }
84          return Arrays.asList(argArray);
85      }
86  
87      public long getTimeStamp() {
88          return timeStamp;
89      }
90  
91      public void setTimeStamp(long timeStamp) {
92          this.timeStamp = timeStamp;
93      }
94  
95      public String getThreadName() {
96          return threadName;
97      }
98  
99      public void setThreadName(String threadName) {
100         this.threadName = threadName;
101     }
102 
103     public Throwable getThrowable() {
104         return throwable;
105     }
106 
107     public void setThrowable(Throwable throwable) {
108         this.throwable = throwable;
109     }
110 
111     @Override
112     public List<KeyValuePair> getKeyValuePairs() {
113         return keyValuePairList;
114     }
115 }