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

org.liblouis.Logger Maven / Gradle / Ivy

Go to download

JNA based Java bindings to liblouis, an open-source braille translator and back-translator.

The newest version!
package org.liblouis;

import java.util.HashMap;
import java.util.Map;

public interface Logger {
	
	public void log(Level level, String message);
	
	public enum Level {
		ALL(-2147483648),
		DEBUG(10000),
		INFO(20000),
		WARN(30000),
		ERROR(40000),
		FATAL(50000),
		OFF(2147483647);
		private final int value;
		private Level(int value) {
			this.value = value;
		}
		int value() {
			return value;
		}
		boolean above(Level threshold) {
		    if (threshold == OFF)
			return false;
		    else if (threshold == ALL)
			return true;
		    else
			return value >= threshold.value;
		}
		private static Map levels;
		static Level from(int value) {
			if (levels == null) {
				levels = new HashMap();
				for (Level l : values())
					levels.put(l.value(), l);
			}
			return levels.get(value);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy