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      	if(markers == null) {
34  			markers = new ArrayList<>(5);
35  		}
36  		return markers;
37      }
38  
39      public void addMarker(Marker marker) {
40          getMarkers().add(marker);
41      }
42  
43      public String getLoggerName() {
44          return loggerName;
45      }
46  
47      public void setLoggerName(String loggerName) {
48          this.loggerName = loggerName;
49      }
50  
51      public SubstituteLogger getLogger() {
52          return logger;
53      }
54  
55      public void setLogger(SubstituteLogger logger) {
56          this.logger = logger;
57      }
58  
59      public String getMessage() {
60          return message;
61      }
62  
63      public void setMessage(String message) {
64          this.message = message;
65      }
66  
67      public Object[] getArgumentArray() {
68          return argArray;
69      }
70  
71      public void setArgumentArray(Object[] argArray) {
72          this.argArray = argArray;
73      }
74  
75  	@Override
76  	public List<Object> getArguments() {
77  		if(argArray == null) {
78  			return null;
79  		}
80  		return Arrays.asList(argArray);
81  	}
82  	
83      public long getTimeStamp() {
84          return timeStamp;
85      }
86  
87      public void setTimeStamp(long timeStamp) {
88          this.timeStamp = timeStamp;
89      }
90  
91      public String getThreadName() {
92          return threadName;
93      }
94  
95      public void setThreadName(String threadName) {
96          this.threadName = threadName;
97      }
98  
99      public Throwable getThrowable() {
100         return throwable;
101     }
102 
103     public void setThrowable(Throwable throwable) {
104         this.throwable = throwable;
105     }
106 
107 
108 	@Override
109 	public List<KeyValuePair> getKeyValuePairs() {
110 		return keyValuePairList;
111 	}
112 }