I have some Java code running in the IntelliJ IDE, and I am using third party libraries that print a lot of messages (using System.err) as part of their main functionality. As a result the output I see in the IntelliJ terminal is quite messy.
I want to ask the community if there is a way of hide the messages that come from System.err in the IntelliJ terminal so only the output from System.out is shown.
Update: The question is focused on how to modify the IntelliJ IDE to not show the errors. Without modifying the code.
Thanks in advance.
1 Answer. Show activity on this post. Add java.exe at File | Settings | Editor | General | Console, Fold console lines that contain. IDE will collapse the command line and it will be less distracting.
You can hide all metrics by disabling "Code Vision" (CTRL+SHIFT+ALL code vision for a quick access in the settings). You can also hide specific metrics by right clicking on it.
Press Ctrl+L in the built-in terminal in IDE. It clears the terminal.
You can install the GrepConsole Plugin and try to create a regex pattern that filters out the things you don't want to see.
There are several libraries that first try to find out the logging mechanism your application is using. If they do not find anything, they fall back to Java's own logging mechanism. Java logging prints out log messages on System.err by default.
So you basically have these options:
Redirect System.err to your own custom PrintStream, where you can do all sorts of filtering.
Provide a reasonable configuration for the Java logging mechanism.
Use a logging library - like log4j, logback, or whatever - and do not forget to configure the third-party library in the logging configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With