view src/goodjava/logger/LevelAppender.java @ 1449:dd14d2dce7ee

add appenders
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 28 Feb 2020 21:14:23 -0700
parents
children 85d7c1777357
line wrap: on
line source

package goodjava.logger;


public class LevelAppender implements Appender {
	private final Appender appender;
	private final int level;

	public LevelAppender(Appender appender,int level) {
		this.appender = appender;
		this.level = level;
	}

	public void append(LoggingEvent event) {
		if( event.level >= this.level )
			appender.append(event);
	}

	public void close() {
		appender.close();
	}
}