MCPcopy
hub / github.com/qos-ch/slf4j / XLogger

Class XLogger

slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java:41–207  ·  view source on GitHub ↗

A utility that provides standard mechanisms for logging certain kinds of activities. @author Ralph Goers @author Ceki Gülcü

Source from the content-addressed store, hash-verified

39 * @author Ceki Gülcü
40 */
41public class XLogger extends LoggerWrapper implements Logger {
42
43 private static final String FQCN = XLogger.class.getName();
44 static Marker FLOW_MARKER = MarkerFactory.getMarker("FLOW");
45 static Marker ENTRY_MARKER = MarkerFactory.getMarker("ENTRY");
46 static Marker EXIT_MARKER = MarkerFactory.getMarker("EXIT");
47
48 static Marker EXCEPTION_MARKER = MarkerFactory.getMarker("EXCEPTION");
49 static Marker THROWING_MARKER = MarkerFactory.getMarker("THROWING");
50 static Marker CATCHING_MARKER = MarkerFactory.getMarker("CATCHING");
51
52 static String EXIT_MESSAGE_0 = "exit";
53 static String EXIT_MESSAGE_1 = "exit with ({})";
54
55 static String ENTRY_MESSAGE_0 = "entry";
56 static String ENTRY_MESSAGE_1 = "entry with ({})";
57 static String ENTRY_MESSAGE_2 = "entry with ({}, {})";
58 static String ENTRY_MESSAGE_3 = "entry with ({}, {}, {})";
59 static String ENTRY_MESSAGE_4 = "entry with ({}, {}, {}, {})";
60 static int ENTRY_MESSAGE_ARRAY_LEN = 5;
61 static String[] ENTRY_MESSAGE_ARRAY = new String[ENTRY_MESSAGE_ARRAY_LEN];
62 static {
63 ENTRY_MARKER.add(FLOW_MARKER);
64 EXIT_MARKER.add(FLOW_MARKER);
65 THROWING_MARKER.add(EXCEPTION_MARKER);
66 CATCHING_MARKER.add(EXCEPTION_MARKER);
67
68 ENTRY_MESSAGE_ARRAY[0] = ENTRY_MESSAGE_0;
69 ENTRY_MESSAGE_ARRAY[1] = ENTRY_MESSAGE_1;
70 ENTRY_MESSAGE_ARRAY[2] = ENTRY_MESSAGE_2;
71 ENTRY_MESSAGE_ARRAY[3] = ENTRY_MESSAGE_3;
72 ENTRY_MESSAGE_ARRAY[4] = ENTRY_MESSAGE_4;
73 }
74
75 public enum Level {
76 TRACE("TRACE", LocationAwareLogger.TRACE_INT), DEBUG("DEBUG", LocationAwareLogger.DEBUG_INT), INFO("INFO", LocationAwareLogger.INFO_INT), WARN("WARN",
77 LocationAwareLogger.WARN_INT), ERROR("ERROR", LocationAwareLogger.ERROR_INT);
78
79 private final String name;
80 private final int level;
81
82 public String toString() {
83 return this.name;
84 }
85
86 public int intValue() {
87 return this.level;
88 }
89
90 private Level(String name, int level) {
91 this.name = name;
92 this.level = level;
93 }
94 }
95
96 /**
97 * Given an underlying logger, construct an XLogger
98 *

Callers

nothing calls this directly

Calls 3

getMarkerMethod · 0.95
getNameMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected