001package org.slf4j.event;
002
003import java.util.ArrayList;
004import java.util.Arrays;
005import java.util.List;
006
007import org.slf4j.Marker;
008import org.slf4j.helpers.SubstituteLogger;
009
010public class SubstituteLoggingEvent implements LoggingEvent {
011
012    Level level;
013    List<Marker> markers;
014    String loggerName;
015    SubstituteLogger logger;
016    String threadName;
017    String message;
018    Object[] argArray;
019    List<KeyValuePair> keyValuePairList;
020
021    long timeStamp;
022    Throwable throwable;
023
024    public Level getLevel() {
025        return level;
026    }
027
028    public void setLevel(Level level) {
029        this.level = level;
030    }
031
032    public List<Marker> getMarkers() {
033        return markers;
034    }
035
036    public void addMarker(Marker marker) {
037        if (marker == null)
038            return;
039
040        if (markers == null) {
041            markers = new ArrayList<>(2);
042        }
043
044        markers.add(marker);
045    }
046
047    public String getLoggerName() {
048        return loggerName;
049    }
050
051    public void setLoggerName(String loggerName) {
052        this.loggerName = loggerName;
053    }
054
055    public SubstituteLogger getLogger() {
056        return logger;
057    }
058
059    public void setLogger(SubstituteLogger logger) {
060        this.logger = logger;
061    }
062
063    public String getMessage() {
064        return message;
065    }
066
067    public void setMessage(String message) {
068        this.message = message;
069    }
070
071    public Object[] getArgumentArray() {
072        return argArray;
073    }
074
075    public void setArgumentArray(Object[] argArray) {
076        this.argArray = argArray;
077    }
078
079    @Override
080    public List<Object> getArguments() {
081        if (argArray == null) {
082            return null;
083        }
084        return Arrays.asList(argArray);
085    }
086
087    public long getTimeStamp() {
088        return timeStamp;
089    }
090
091    public void setTimeStamp(long timeStamp) {
092        this.timeStamp = timeStamp;
093    }
094
095    public String getThreadName() {
096        return threadName;
097    }
098
099    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}