Collection of useful utilities for Java games and apps. A lot of interesting utilities that could maybe still find some use if you work with Java...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mightyutils/src/mightypork/utils/logging/monitors/LogMonitor.java

36 lines
576 B

package mightypork.utils.logging.monitors;
import java.util.logging.Level;
public abstract class LogMonitor {
private boolean enabled = true;
private Level accepted = Level.ALL;
public void onMessageLogged(Level level, String message)
{
if (!enabled) return;
if (accepted.intValue() > level.intValue()) return;
logMessage(level, message);
}
protected abstract void logMessage(Level level, String message);
public void setLevel(Level level)
{
this.accepted = level;
}
public void enable(boolean flag)
{
this.enabled = flag;
}
}