Skip to content

Commit 1718c4a

Browse files
committedMar 27, 2018
Handle this deprecation differently.
1 parent 2a265b1 commit 1718c4a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

Diff for: ‎core/src/test/java/org/jruby/util/log/LoggerFactoryTest.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public void usesStandardErrorLoggerByDefault() {
4949
}
5050

5151
@Test
52+
@SuppressWarnings("deprecation")
5253
public void usingJULLogger() throws Exception {
5354
final ByteArrayOutputStream out = new ByteArrayOutputStream();
5455
java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger("JULLogger");
@@ -95,7 +96,7 @@ public synchronized String format(java.util.logging.LogRecord record) {
9596

9697
changeLoggerImpl(JULLogger.class);
9798

98-
Logger logger = LoggerFactory.getLogger(LoggerFactoryTest.class);
99+
Logger logger = LoggerFactory.getLogger("JULLogger");
99100
assertFalse( logger.isDebugEnabled() );
100101

101102
logger.debug("ignored debug stuff");
@@ -107,11 +108,11 @@ public synchronized String format(java.util.logging.LogRecord record) {
107108

108109
logger.info("logged at info level");
109110
handler.flush();
110-
assertEquals(log += "LoggerFactoryTest INFO: logged at info level\n", out.toString());
111+
assertEquals(log += "JULLogger INFO: logged at info level\n", out.toString());
111112

112113
logger.warn("logged at {} {}", "warn", new StringBuilder("level"));
113114
handler.flush();
114-
assertEquals(log += "LoggerFactoryTest WARNING: logged at warn level\n", out.toString());
115+
assertEquals(log += "JULLogger WARNING: logged at warn level\n", out.toString());
115116

116117
julLogger.setLevel(java.util.logging.Level.WARNING);
117118

@@ -122,7 +123,7 @@ public synchronized String format(java.util.logging.LogRecord record) {
122123

123124
logger.error("bad news", new RuntimeException("exception happened"));
124125
handler.flush();
125-
assertStartsWith(log += "LoggerFactoryTest SEVERE: bad news\njava.lang.RuntimeException: exception happened", out.toString());
126+
assertStartsWith(log += "JULLogger SEVERE: bad news\njava.lang.RuntimeException: exception happened", out.toString());
126127
}
127128

128129
@Test

0 commit comments

Comments
 (0)
Please sign in to comment.