Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide or ignore System.err outputs in IntelliJ console

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.

like image 282
miguelmalvarez Avatar asked Nov 29 '13 12:11

miguelmalvarez


People also ask

How do I hide the command line in IntelliJ console output?

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.

How do I hide usage in IntelliJ?

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.

How do I clear my console log in IntelliJ?

Press Ctrl+L in the built-in terminal in IDE. It clears the terminal.


2 Answers

You can install the GrepConsole Plugin and try to create a regex pattern that filters out the things you don't want to see.

like image 127
maba Avatar answered Oct 13 '22 15:10

maba


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:

  1. Redirect System.err to your own custom PrintStream, where you can do all sorts of filtering.

  2. Provide a reasonable configuration for the Java logging mechanism.

  3. Use a logging library - like log4j, logback, or whatever - and do not forget to configure the third-party library in the logging configuration.

like image 28
Seelenvirtuose Avatar answered Oct 13 '22 16:10

Seelenvirtuose