Hi everyone, i'm having a problem with BarAPI, it spams my console like crazy but it is still working, can someone please right here an example code for how to delete a certain string from the log? Thanks in advance
@Sw_aG Please post what you have. We aren't here to spoonfeed you, we're here to help you with your current code.
I've actually already tried to remove the try and catch fields but it is needed or something i don't really know how to do it Without it breaking the plugin. Do you know what it is?
@Sw_aG I cannot see how removing a line printing could break anything. What is the line you are removing?
@Sw_aG You could use a filter Filter class Code: public class ConsoleFilter implements Filter { @Override public boolean isLoggable(LogRecord record) { return !message.contains("[BarAPI]");// Dont know what messages barapi, guessing they have a prefix ; } } And in your onEnable method Code: ConsoleFilter filter = new ConsoleFilter(); this.getLogger().setFilter(filter); To maximize the effect In your plugin.yml Code: name: whatever ... loadbefore: [BarApi]
The code before changing: And the code after: @Ruptur Sorry its kinda new to me i don't really know anything about filters...
@Sw_aG I gave an example above i can add comments if you want. If you want to remove the tracktraces. You dont remove the try & catch blocks Just remove the e.printStackTrace() Code: try { somethingtothrowerror } catch(Exception ignored) {}
@Sw_aG So the plugin is throwing lots of errors? You might want to look into errors more than stop console spam. Even if you stop the spam the errors are there but if you fix the errors the spam is gone.
@Ruptur Traces are there for a reason, they are not thrown just because they can, they represent an error that occured.. "Muting" them does not take you out of harm's way, i recomend you post the error in console, here so we can read it, trace it and sugest a solution.
@mine-care Question was : ... have problem with BarAPI ... spams my console ... please right here an example code for how to delete a certain string from the log? And i answered the question by giving an example. If you have a tip, tahg the thread owner not me. Thanks
Ahh, its all good, fixed everything, thank you every1 and have a good day! Moderators can now lock this thread (I used to know how)