Code example for LogRecord

0
		ConsoleHandler h = new ConsoleHandler();
		h.setFilter(new MockFilter());
 
		System.setErr(new PrintStream(new ByteArrayOutputStream()));
 
		LogRecord r = new LogRecord(Level.INFO, "testPublish_WithFilter");
		h.setLevel(Level.INFO);
		h.publish(r);
		assertNull(CallVerificationStack.getInstance().pop());
		assertSame(r, CallVerificationStack.getInstance().pop());
		assertEquals("", this.errSubstituteStream.toString());
	} 
 
	/* 
	 * Test publish(), use a filter, having output stream, normal log record. 
	 */ 
	public void testPublish_WithFilter() throws Exception { 
		Properties p = new Properties();
		p.put("java.util.logging.ConsoleHandler.formatter", className
				+ "$MockFormatter"); 
		LogManager.getLogManager().readConfiguration(