All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aktin.broker.query.Logger Maven / Gradle / Ivy

package org.aktin.broker.query;

import java.io.PrintStream;
import java.util.logging.Level;

/**
 * Logger interface to handle errors/messages during query processing.
 * @author R.W.Majeed
 *
 */
public interface Logger {

	void log(Level level, String message, String location, Throwable throwable);

	
	public static Logger streamLogger(PrintStream out) {
		return new Logger() {
			@Override
			public void log(Level level, String message, String location, Throwable throwable) {
				if( throwable != null ) {
					throwable.printStackTrace(out);
				}
				out.println(".. by");
				out.println(level.toString()+": "+message);
			}
		};
	}
	public static Logger stderrLogger() {
		return streamLogger(System.err);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy