Code example for LogRecord

Methods: getLevelgetMessagegetParametersgetSourceClassNamegetThrown

0
	public void flush() { 
	} 
 
	@Override 
	public void publish(LogRecord record) {
		Level level = record.getLevel();
		String clsName = record.getSourceClassName();
		String msg = String.format(record.getMessage(), record.getParameters());
		Throwable t = record.getThrown();
 
		if (level == Level.INFO) {
			Log.i(clsName, msg, t);
		} else if (level == Level.SEVERE) {
			Log.e(clsName, msg, t);
		} else if (level == Level.WARNING) {
			Log.w(clsName, msg, t);
		} else if (level == Level.CONFIG) {
			Log.d(clsName, msg, t);
		} else if (level == Level.FINE || level == Level.FINER
				|| level == Level.FINEST) {
Stop searching for code, let great code find you!  Add Codota to your java IDE