@@ -49,6 +49,7 @@ public void usesStandardErrorLoggerByDefault() {
49
49
}
50
50
51
51
@ Test
52
+ @ SuppressWarnings ("deprecation" )
52
53
public void usingJULLogger () throws Exception {
53
54
final ByteArrayOutputStream out = new ByteArrayOutputStream ();
54
55
java .util .logging .Logger julLogger = java .util .logging .Logger .getLogger ("JULLogger" );
@@ -95,7 +96,7 @@ public synchronized String format(java.util.logging.LogRecord record) {
95
96
96
97
changeLoggerImpl (JULLogger .class );
97
98
98
- Logger logger = LoggerFactory .getLogger (LoggerFactoryTest . class );
99
+ Logger logger = LoggerFactory .getLogger ("JULLogger" );
99
100
assertFalse ( logger .isDebugEnabled () );
100
101
101
102
logger .debug ("ignored debug stuff" );
@@ -107,11 +108,11 @@ public synchronized String format(java.util.logging.LogRecord record) {
107
108
108
109
logger .info ("logged at info level" );
109
110
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 ());
111
112
112
113
logger .warn ("logged at {} {}" , "warn" , new StringBuilder ("level" ));
113
114
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 ());
115
116
116
117
julLogger .setLevel (java .util .logging .Level .WARNING );
117
118
@@ -122,7 +123,7 @@ public synchronized String format(java.util.logging.LogRecord record) {
122
123
123
124
logger .error ("bad news" , new RuntimeException ("exception happened" ));
124
125
handler .flush ();
125
- assertStartsWith (log += "LoggerFactoryTest SEVERE: bad news\n java.lang.RuntimeException: exception happened" , out .toString ());
126
+ assertStartsWith (log += "JULLogger SEVERE: bad news\n java.lang.RuntimeException: exception happened" , out .toString ());
126
127
}
127
128
128
129
@ Test
0 commit comments