Control stack trace verbosity

After some time working with Julia I’ve gotten used to the stack trace and the huge amount of information it provides. Nonetheless, I still keep wondering if it would be possible to have some control over what is displayed.

For the vast majority of debugging I’m doing, I find myself constantly browsing through several lines in the stack trace in search for the files of the repo/package I’m developing. Would it be possible to somehow filter the stack trace to ONLY show the lines from files present in the current repository/folder? This would make my life so much easier most of the times, since 99% of the errors I’m debugging are from the packages I’m developing, and not other packages I’m including (as it should be!). Thanks in advance!

3 Likes

Interesting question: in the presence of threads the trace backs are even more complicated. So should there be a way to specify ‘trusted’ libraries to only show the first entry of a trace back into the ‘trusted’ callstack?

I for one would mostly trust Base.

See also: Suggestion: abbreviate stack traces by default · Issue #40138 · JuliaLang/julia · GitHub

2 Likes

Good to see I’m not the only one who feels that way! There might be different strategies on how to achieve that, but modularity and some sort of settings to control that to set it to everyone’s taste would be highly appreciated.

For newcomers, it can be extremely daunting seeing the wall of text that is dumped every time an error occurs. It is ridiculous the amount of time I spend every day scrolling up to go see the actual error when debugging.

While waiting for a more definitive solution at language level, I’ve found the AbbreviatedStackTraces.jl package to be a good temporary solution.