Package list libslf4j-java / 5e2d412
New upstream version 1.7.31 Emmanuel Bourg 30 days ago
19 changed file(s) with 117 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>integration</artifactId>
44 <parent>
55 <groupId>org.slf4j</groupId>
66 <artifactId>slf4j-parent</artifactId>
7 <version>1.7.30</version>
7 <version>1.7.31</version>
88 </parent>
99
1010 <modelVersion>4.0.0</modelVersion>
103103 * the message to log. Converted to {@link String}
104104 */
105105 public void trace(Object message) {
106 logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String.valueOf(message), null, null);
106 if (isTraceEnabled()) {
107 logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String.valueOf(message), null, null);
108 }
107109 }
108110
109111 /**
116118 * the exception to log
117119 */
118120 public void trace(Object message, Throwable t) {
119 logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String.valueOf(message), null, t);
121 if (isTraceEnabled()) {
122 logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String.valueOf(message), null, t);
123 }
120124 }
121125
122126 /**
127131 * the message to log. Converted to {@link String}
128132 */
129133 public void debug(Object message) {
130 logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String.valueOf(message), null, null);
134 if (isDebugEnabled()) {
135 logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String.valueOf(message), null, null);
136 }
131137 }
132138
133139 /**
140146 * the exception to log
141147 */
142148 public void debug(Object message, Throwable t) {
143 logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String.valueOf(message), null, t);
149 if (isDebugEnabled()) {
150 logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String.valueOf(message), null, t);
151 }
144152 }
145153
146154 /**
151159 * the message to log. Converted to {@link String}
152160 */
153161 public void info(Object message) {
154 logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String.valueOf(message), null, null);
162 if (isInfoEnabled()) {
163 logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String.valueOf(message), null, null);
164 }
155165 }
156166
157167 /**
164174 * the exception to log
165175 */
166176 public void info(Object message, Throwable t) {
167 logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String.valueOf(message), null, t);
177 if (isInfoEnabled()) {
178 logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String.valueOf(message), null, t);
179 }
168180 }
169181
170182 /**
175187 * the message to log. Converted to {@link String}
176188 */
177189 public void warn(Object message) {
178 logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String.valueOf(message), null, null);
190 if (isWarnEnabled()) {
191 logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String.valueOf(message), null, null);
192 }
179193 }
180194
181195 /**
188202 * the exception to log
189203 */
190204 public void warn(Object message, Throwable t) {
191 logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String.valueOf(message), null, t);
205 if (isWarnEnabled()) {
206 logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String.valueOf(message), null, t);
207 }
192208 }
193209
194210 /**
199215 * the message to log. Converted to {@link String}
200216 */
201217 public void error(Object message) {
202 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, null);
218 if (isErrorEnabled()) {
219 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, null);
220 }
203221 }
204222
205223 /**
212230 * the exception to log
213231 */
214232 public void error(Object message, Throwable t) {
215 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, t);
233 if (isErrorEnabled()) {
234 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, t);
235 }
216236 }
217237
218238 /**
223243 * the message to log. Converted to {@link String}
224244 */
225245 public void fatal(Object message) {
226 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, null);
246 if (isErrorEnabled()) {
247 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, null);
248 }
227249 }
228250
229251 /**
236258 * the exception to log
237259 */
238260 public void fatal(Object message, Throwable t) {
239 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, t);
261 if (isErrorEnabled()) {
262 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null, t);
263 }
240264 }
241265
242266 /**
2626
2727 import static org.junit.Assert.assertFalse;
2828 import static org.junit.Assert.assertTrue;
29 import static org.junit.Assert.assertEquals;
2930
3031 import org.junit.Test;
3132
8485 log.fatal(null, e);
8586 log.fatal("fatal message", e);
8687 }
88
89 @Test
90 public void testAvoidConvertingObjectToString() {
91 Log log = LogFactory.getLog(InvokeJCLTest.class);
92 Exception e = new Exception("just testing");
93
94 TestMessage fatalMsg = new TestMessage("fatal msg");
95 TestMessage errorMsg = new TestMessage("error msg");
96 TestMessage warnMsg = new TestMessage("warn msg");
97 TestMessage infoMsg = new TestMessage("info msg");
98 TestMessage debugMsg = new TestMessage("debug msg");
99 TestMessage traceMsg = new TestMessage("trace msg");
100
101 log.fatal(fatalMsg);
102 log.fatal(fatalMsg, e);
103 assertEquals(2, fatalMsg.invokedCount);
104
105 log.error(errorMsg);
106 log.error(errorMsg, e);
107 assertEquals(2, errorMsg.invokedCount);
108
109 log.warn(warnMsg);
110 log.warn(warnMsg, e);
111 assertEquals(2, warnMsg.invokedCount);
112
113 log.info(infoMsg);
114 log.info(infoMsg, e);
115 assertEquals(2, infoMsg.invokedCount);
116
117 log.debug(debugMsg);
118 log.debug(debugMsg, e);
119 assertEquals(0, debugMsg.invokedCount);
120
121 log.trace(traceMsg);
122 log.trace(traceMsg, e);
123 assertEquals(0, traceMsg.invokedCount);
124 }
125
126 static class TestMessage {
127
128 private final String msg;
129 int invokedCount = 0;
130
131 TestMessage(String msg) {this.msg = msg;}
132
133 @Override
134 public String toString() {
135 invokedCount++;
136 return msg;
137 }
138 }
139
87140 }
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>jul-to-slf4j</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212
1414 */
1515 package org.apache.log4j;
1616
17 /**
18 * Skeleton implementation of ConsoleAppender
19 */
1720 public class ConsoleAppender extends WriterAppender {
1821
22 public ConsoleAppender() {
23 }
24
25 public ConsoleAppender(Layout layout) {
26 }
27
28 public ConsoleAppender(Layout layout, String target) {
29 }
30
1931 }
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>osgi-over-slf4j</artifactId>
55
66 <groupId>org.slf4j</groupId>
77 <artifactId>slf4j-parent</artifactId>
8 <version>1.7.30</version>
8 <version>1.7.31</version>
99
1010 <packaging>pom</packaging>
1111 <name>SLF4J</name>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-android</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-api</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-ext</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-jcl</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-jdk14</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-log4j12</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-migrator</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-nop</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-simple</artifactId>
66 <parent>
77 <groupId>org.slf4j</groupId>
88 <artifactId>slf4j-parent</artifactId>
9 <version>1.7.30</version>
9 <version>1.7.31</version>
1010 </parent>
1111
1212 <artifactId>slf4j-site</artifactId>