Small feature suggestion

Sometimes, while developing, I encounter a stack trace that I don't want to diagnose right now, but would like to keep around to look at later.

It would be nice if there was some UI where I could:
1) Save this StackTrace
2) List saved StackTraces

Currently I do this by copying and pasting into text files.

It might also be nice if there was just a running log of all observed stack traces (thought would have to go in to how long to keep them, just for the current IDEA session?/keep them all until the user resets them?).

Edited by: Aaron Cohen on Sep 8, 2008 11:31 PM

Edited by: Aaron Cohen on Sep 8, 2008 11:32 PM

Edited by: Aaron Cohen on Sep 8, 2008 11:33 PM

6 comments
Comment actions Permalink

IIt sounds like you want IDEA to do your application logging for you. Have you ever thought of actually using logging (like Log4j, or Apache Commons) in your applications? This way, you can have a complete control of any log output, where it goes, its format, etc. You can configure your logger so it logs to the console as well as a file where you can always analyze the logs at any time later. This is actually the right way to do it... ;)

Cheers,
constantine

P.S. You really do need to be using logging in your apps, dude... (I disagree with those who think that logging replaces debugging - that's why I love IntelliJ's debugger so much, - but logging is essential for many purposes, such as studying stack traces at a later time.)

0
Comment actions Permalink

You can configure your logger so it logs to the console as well as a file where you can always analyze the logs at any time later.

Alternatively, you can edit your "Run" configuration(s) (either for application or tests) so the log file is shown as an added tab in the "Run" (or "Debug") tool window. And the cool thing is IDEA only shows the log output for that run. So you do not get things mixed up as to what happened two runs ago and what happened in the current run as a result of scrolling too far back in a log file. Also, the window gives you some filtering on the levels which can be very useful.

Unfortunately, in IDEA 7 there is a small bug (see http://www.jetbrains.net/jira/browse/IDEA-17511) with this feature that results in the need to click on to the log tab, back on the console tab, and then again on the log tab in order to see the output. But it is resolved in IDEA 8. In DEA 8, they also added the ability to detach this tab. But unfortunately, it does not update on subsequent runs. (See http://www.jetbrains.net/jira/browse/IDEA-19517). Hopefully this will get fixed.

To configure this:
1) open the Edit Run/Debug configurations dialog
2) select the desired configuration definition
3) Click the "logs" tab
4) click the "add button"
5) Enter the desired values in the "Edit Log Files Aliases" dialog and click OK
6) Select the check box under teh "IS Active" column on the log tab
7) click OK or Apply on the Run/Debug configurations dialog

What I typically do for a project is to define this in the Default "application" and "JUnit" configuration definitions by clicking the "Edit Defaults" button in the lower left of the "Run/Debug Configurations" dialog. This way I only have to set this once and its "automatically" configured when I create a definition on the fly via ctrlshiftf10.

0
Comment actions Permalink

Hello Aaron,

Sometimes, while developing, I encounter a stack trace that I don't
want to diagnose right now, but would like to keep around to look at
later.

It would be nice if there was some UI where I could:
1) Save this StackTrace
2) List saved StackTraces
Currently I do this by copying and pasting into text files.


This is far too specific and narrow use case for a core product feature,
but it's very easily implemented as a third-party plugin.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Logging is somewhat less useful in that stack traces in the console have clickable line references but stack traces in log files do not.

0
Comment actions Permalink

Hello Donald,

Logging is somewhat less useful in that stack traces in the console
have clickable line references but stack traces in log files do not.


Actually they do. There were some bugs fixed in recent Diana builds which
caused the links not to update properly for large log files, but other than
that the links are supposed to work.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Oh, I do use java logging, what about what I said made you think that I don't?

It's much more a matter of wanting to have a convenient way to put a problem aside for a while. If I have a 130k log file, I have to either copy the stacktrace out of the logfile or make notes to myself right then and there about what it was I care about the log file if I'm going to come back to it later.

0

Please sign in to leave a comment.