Code example for LogRecord

Methods: setMessage

0
        // The RI fails in this test because it uses a MessageFormat to format 
        // the message even though it doesn't contain "{0". The spec says that 
        // this would indicate that a MessageFormat should be used and else no 
        // formatting should be done. 
        String pattern = "pattern without 0 {1, number}";
        r.setMessage(pattern);
        assertEquals(pattern, f.formatMessage(r));
    } 
 
    public static class MockFormatter extends Formatter {
        public String format(LogRecord arg0) {
            return "format"; 
        } 
    } 
}