Hello, I have been coding a custom ban plugin for my friend but I am wondering how can you remove this messages from the console? Code: [21:52:11 INFO]: Disconnecting GameProfile{id='---', name='Pato_the_best'} (/127.0.0.1:59127): §4You have been banned from this server! §fAuthor: §cCONSOLE, §fDate: §c12-01-2014 21:52:08 §fExpires in: §c18seconds §fReason: §cThe ban hammer has spoken [21:52:11 INFO]: GameProfile{id='---', name='Pato_the_best'} (/127.0.0.1:59127) lost connection: §4You have been banned from this server! §fAuthor: §cCONSOLE, §fDate: §c12-01-2014 21:52:08 §fExpires in: §c18seconds Kick code: Code:java @EventHandler //evil line that I always forget but not his time :ppublic void PlayerLoginEvent(PlayerLoginEvent event) {if (SettingsManager.getInstance().checkBan(event.getPlayer().getName())){String player = event.getPlayer().getName();String kickMsg = "";event.disallow(PlayerLoginEvent.Result.KICK_OTHER, kickMsg);}}
add a handler for the logger. (search the APIs yourself, if you need help feel free to quote me and ask me )
http://docs.oracle.com/javase/7/docs/api/java/util/logging/Handler.html http://docs.oracle.com/javase/7/docs/api/java/util/logging/Logger.html
use isLoggable( or something like that) RawCode http://jd.bukkit.org/rb/doxygen/d7/d48/JavaPlugin_8java_source.html i referred to this, so... is it not updated or something?
Louis1234567890987654321 So can you help me? I didn't understand what you posted above. Can you provide me with a piece of code?
PatoTheBest PHP: Logger logger = plugin.getLogger();public class ConsoleHandler extends Handler { String[] stringArray = new String[4] { "Console", "GameProfile", "Expires", "Reason" }; @Override public boolean isLoggable(LogRecord record) { for(String s : stringArray) { if(record.getMessage().contains(s)) { return false; } } return true; }}logger.addHandler(new ConsoleHandler());for(Handler handler : logger.getHandlers()) { if(handler instanceof ConsoleHandler) { handler.close(); }} Try that.