Output history in IntelliJ IDEA
已回答
Hi!
In my code I log useful information to system output using the following JAVA method: System.out.println(...).
Is it possible in IntelliJ IDEA to find a history of information that I wrote to output?
请先登录再写评论。
Console output is not retained between runs. It is one of the inherit shortcomings of console output. You need to use a logging framework in order to retain output between runs. (IDEA can display the output of a log in a tab in the run window if desired.) For a quick hit, you may want to look at the System Out and Err Redirected to SLF4J project that allows, with a single line of code (plus a log config file), all console output to be redirected to a Simple Logging Façade for Java (SLF4J) logger such as Logback. But in general, you'll find it most beneficial to switch to using a logging framework rather than System.out.
One note - it's possible to keep output console within the same ide session. You can just pin it (see below) and it will be preserved:

Denis
Pinning console saves output!
Unfortunately in recent version of IntelliJ pinning the console has no effect.
After the program has exit the console output is directly discarded :(
jp_java Sorry, can't reproduce. What specific console are you referring to? Please share a sample project or a video of the issue at https://uploads.jetbrains.com.