Code example for ConsoleHandler

Methods: publish

0
		Properties p = new Properties();
		p.put("java.util.logging.ConsoleHandler.formatter", className
				+ "$MockFormatter"); 
		LogManager.getLogManager().readConfiguration(
				EnvironmentHelper.PropertiesToInputStream(p));
		ConsoleHandler h = new ConsoleHandler();
		h.publish(null);
	} 
 
	/* 
	 * Test publish(), a log record with empty msg, having output stream 
	 */ 
	public void testPublish_EmptyMsg() throws Exception { 
		Properties p = new Properties();
		p.put("java.util.logging.ConsoleHandler.formatter", className
				+ "$MockFormatter"); 
		LogManager.getLogManager().readConfiguration(
				EnvironmentHelper.PropertiesToInputStream(p));
		ConsoleHandler h = new ConsoleHandler();
		LogRecord r = new LogRecord(Level.INFO, "");
Connect your IDE to all the code out there  Get Codota for Java