Add verbose logging option and a debug method to use it.

Closes #609
This commit is contained in:
NuclearW
2013-02-20 11:47:08 -05:00
parent 918d81198f
commit c805a48a87
4 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package com.gmail.nossr50.util;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
import com.gmail.nossr50.mcMMO;
public class LogFilter implements Filter {
private boolean debug;
public LogFilter(mcMMO plugin) {
// Doing a config loading lite here, because we can't depend on the config loader to have loaded before any debug messages are sent
debug = plugin.getConfig().getBoolean("General.Verbose_Logging");
}
@Override
public boolean isLoggable(LogRecord record) {
if(record.getMessage().contains("[Debug]") && !debug) {
return false;
}
else {
return true;
}
}
}